mirror of
https://github.com/openglobus/openglobus.git
synced 2025-12-08 19:25:27 +00:00
Fixed tests with mocks
This commit is contained in:
parent
e3c4ef6a7f
commit
65cab5d5c5
@ -11,5 +11,9 @@ module.exports = {
|
||||
testRegex: [
|
||||
"\\.test\\.js$",
|
||||
"\\.test\\.ts$",
|
||||
]
|
||||
],
|
||||
moduleNameMapper: {
|
||||
'\\.worker\\.js\\?worker&inline$': '<rootDir>/tests/__mocks__/workerMock.js',
|
||||
'\\.glsl$': '<rootDir>/tests/__mocks__/glslMock.js'
|
||||
}
|
||||
};
|
||||
|
||||
1
tests/__mocks__/glslMock.js
Normal file
1
tests/__mocks__/glslMock.js
Normal file
@ -0,0 +1 @@
|
||||
export default 'void main() {}';
|
||||
10
tests/__mocks__/workerMock.js
Normal file
10
tests/__mocks__/workerMock.js
Normal file
@ -0,0 +1,10 @@
|
||||
export default class MockWorker {
|
||||
constructor() {
|
||||
this.postMessage = jest.fn();
|
||||
this.terminate = jest.fn();
|
||||
this.addEventListener = jest.fn();
|
||||
this.removeEventListener = jest.fn();
|
||||
this.onmessage = null;
|
||||
this.onerror = null;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user