'jasmine getFixtures is not a function

I'm developing some unitTests using Jasmine. I'm currently working on Windows8.1 and when I run my test I get following error message.

TypeError: jasmine.getFixtures() is not a function

This is the code that I'm using. I don't know what I must change in order to do this work.

Karma.conf.js

//More configuration entries
 ...........
  files: [
// app-specific code
'src/app/app.js',

// 3rd-party resources
'node_modules/angular-mocks/angular-mocks.js',

// test files
'test/unit/**/*.js',

//fixture to serve mockData in Tests
{ pattern: 'test/unit/mock-data/*.json' }
]

Here is the piece of code from my test.

it('Should load my fixture', function(){
    jasmine.getFixtures().fixturesPath = 'HpIpsUi/test/unit/mock-data';
    var json = readFixtures('diagnostics.json');
    var result = JSON.parse(json);
    expect(result).toBeDefined();1
})

It's not recognizing my call to the function jasmine.getFictures().

Thank you for your help



Solution 1:[1]

Have you included the jasmine-query library? It's defined there, not in the jasmine library.

Said jasmine-query.js needs to be downloaded, and added as file, because it's not installable with npm yet.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Top-Master