我的 Karma 配置文件中的 files 属性是
files: [
// Program files
'public/js/init.js',
// Load mocks directly from bower
'bower_components/angular-mocks/angular-mocks.js',
// Fixtures
{
pattern: 'test/fixtures/*.json',
watched: true,
served: true,
included: false
},
// Specs
'test/unit/**/*.spec.*'
]
其中一个固定装置如下:test/fixtures/languages.json
{
"ab":{
"name":"Abkhaz",
"nativeName":"аҧсуа"
},
"aa":{
"name":"Afar",
"nativeName":"Afaraf"
},
"af":{
"name":"Afrikaans",
"nativeName":"Afrikaans"
}
}
如何在期望语句的变量中加载上面提到的 json?