mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
35 lines
672 B
TypeScript
35 lines
672 B
TypeScript
import Config from 'webpack-chain';
|
|
|
|
import {
|
|
mockExistsSync,
|
|
restoreExistsSync,
|
|
setHasTSConfig,
|
|
} from '../../scripts/jest.utils';
|
|
|
|
import svelte from '../../src/configuration/svelte';
|
|
import { init } from '../../src';
|
|
|
|
jest.mock('__jest__/svelte.config.js', () => {}, { virtual: true });
|
|
|
|
describe('svelte configuration', () => {
|
|
const platforms = ['ios', 'android'];
|
|
|
|
beforeAll(() => {
|
|
mockExistsSync();
|
|
setHasTSConfig(true);
|
|
});
|
|
|
|
afterAll(() => {
|
|
restoreExistsSync();
|
|
});
|
|
|
|
for (let platform of platforms) {
|
|
it(`for ${platform}`, () => {
|
|
init({
|
|
[platform]: true,
|
|
});
|
|
expect(svelte(new Config()).toString()).toMatchSnapshot();
|
|
});
|
|
}
|
|
});
|