|
1 | 1 | import type * as d from '@stencil/core/declarations';
|
2 | 2 | import { mockBuildCtx, mockCompilerCtx, mockCompilerSystem, mockValidatedConfig } from '@stencil/core/testing';
|
3 |
| -import { DIST, normalize } from '@utils'; |
| 3 | +import { DIST, resolve } from '@utils'; |
4 | 4 |
|
5 | 5 | import { validateDist } from '../../config/outputs/validate-dist';
|
6 | 6 | import { outputLazyLoader } from '../output-lazy-loader';
|
@@ -46,28 +46,28 @@ describe('Lazy Loader Output Target', () => {
|
46 | 46 |
|
47 | 47 | const expectedIndexOutput = `export * from '../esm/polyfills/index.js';
|
48 | 48 | export * from '../esm-es5/loader.js';`;
|
49 |
| - expect(writeFileSpy).toHaveBeenCalledWith(normalize('/my-test-dir/loader/index.js'), expectedIndexOutput); |
| 49 | + expect(writeFileSpy).toHaveBeenCalledWith(resolve('/my-test-dir/loader/index.js'), expectedIndexOutput); |
50 | 50 |
|
51 | 51 | const expectCjsIndexOutput = `module.exports = require('../cjs/loader.cjs.js');
|
52 | 52 | module.exports.applyPolyfills = function() { return Promise.resolve() };`;
|
53 |
| - expect(writeFileSpy).toHaveBeenCalledWith(normalize('/my-test-dir/loader/index.cjs.js'), expectCjsIndexOutput); |
| 53 | + expect(writeFileSpy).toHaveBeenCalledWith(resolve('/my-test-dir/loader/index.cjs.js'), expectCjsIndexOutput); |
54 | 54 |
|
55 | 55 | const expectes2017Output = `export * from '../esm/polyfills/index.js';
|
56 | 56 | export * from '../esm/loader.js';`;
|
57 |
| - expect(writeFileSpy).toHaveBeenCalledWith(normalize('/my-test-dir/loader/index.es2017.js'), expectes2017Output); |
| 57 | + expect(writeFileSpy).toHaveBeenCalledWith(resolve('/my-test-dir/loader/index.es2017.js'), expectes2017Output); |
58 | 58 | });
|
59 | 59 |
|
60 | 60 | it('should exclude polyfill code when buildEs5=false', async () => {
|
61 | 61 | ({ config, compilerCtx, writeFileSpy } = setup({ buildEs5: false }));
|
62 | 62 | await outputLazyLoader(config, compilerCtx);
|
63 | 63 |
|
64 | 64 | const expectedIndexOutput = `export * from '../esm/loader.js';`;
|
65 |
| - expect(writeFileSpy).toHaveBeenCalledWith(normalize('/my-test-dir/loader/index.js'), expectedIndexOutput); |
| 65 | + expect(writeFileSpy).toHaveBeenCalledWith(resolve('/my-test-dir/loader/index.js'), expectedIndexOutput); |
66 | 66 |
|
67 | 67 | const expectCjsIndexOutput = `module.exports = require('../cjs/loader.cjs.js');`;
|
68 |
| - expect(writeFileSpy).toHaveBeenCalledWith(normalize('/my-test-dir/loader/index.cjs.js'), expectCjsIndexOutput); |
| 68 | + expect(writeFileSpy).toHaveBeenCalledWith(resolve('/my-test-dir/loader/index.cjs.js'), expectCjsIndexOutput); |
69 | 69 |
|
70 | 70 | const expectes2017Output = `export * from '../esm/loader.js';`;
|
71 |
| - expect(writeFileSpy).toHaveBeenCalledWith(normalize('/my-test-dir/loader/index.es2017.js'), expectes2017Output); |
| 71 | + expect(writeFileSpy).toHaveBeenCalledWith(resolve('/my-test-dir/loader/index.es2017.js'), expectes2017Output); |
72 | 72 | });
|
73 | 73 | });
|
0 commit comments