Hello there,
I have this error in multiple unit tests:
FAIL src/features/state-tree/actions.spec.js
● Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'get')
2 | import { Store } from 'aurelia-store';
3 |
> 4 | export default Container.instance.get(Store);
| ^
5 |
at Object.get (src/features/state-tree/store.js:4:35)
at Object.require (src/features/state-tree/actions.js:1:1)
at Object.require (src/features/state-tree/actions.spec.js:1:1)
I’m using jest with the following configuration:
// jest.pretest
import 'aurelia-polyfills';
import {Options} from 'aurelia-loader-nodejs';
import {globalize} from 'aurelia-pal-nodejs';
import path from 'path';
Options.relativeToDir = path.join(__dirname, 'unit');
globalize();
Could someone advise me on what needs to be done to get the Aurelia 1 store in my tests?