mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: organize test files
This commit is contained in:
committed by
Nathan Walker
parent
5181769328
commit
1cd6df370b
@@ -42,7 +42,7 @@ describe('@nativescript/webpack', () => {
|
||||
lastCalled = true;
|
||||
expect(config.normal).toBe(true);
|
||||
});
|
||||
webpack.chainWebpack(chainFnLast, { last: true });
|
||||
webpack.chainWebpack(chainFnLast, { order: 10 });
|
||||
|
||||
const chainFnNormal = jest.fn((config) => {
|
||||
config.normal = true;
|
||||
@@ -55,6 +55,22 @@ describe('@nativescript/webpack', () => {
|
||||
webpack.resolveChainableConfig();
|
||||
});
|
||||
|
||||
it('prints plugin name that errored out', () => {
|
||||
webpack.useConfig(false);
|
||||
webpack.setCurrentPlugin('test-plugin');
|
||||
const chainFn = jest.fn(() => {
|
||||
throw new Error('something wrong');
|
||||
});
|
||||
webpack.chainWebpack(chainFn);
|
||||
|
||||
// should not throw
|
||||
expect(() => webpack.resolveChainableConfig()).not.toThrow();
|
||||
|
||||
expect(
|
||||
'Unable to apply chain function from: test-plugin'
|
||||
).toHaveBeenWarned();
|
||||
});
|
||||
|
||||
it('applies merge configs', () => {
|
||||
const dummyEnv = { env: true };
|
||||
webpack.init(dummyEnv);
|
||||
|
||||
Reference in New Issue
Block a user