feat(webpack): default tsconfig.json if not found

This commit is contained in:
Igor Randjelovic
2022-02-18 15:17:06 +01:00
parent 4fa51b6064
commit 48c51f6163
14 changed files with 934 additions and 44 deletions

View File

@ -1,11 +1,25 @@
import Config from 'webpack-chain';
import {
mockExistsSync,
restoreExistsSync,
setHasTSConfig,
} from '../../scripts/jest.utils';
import vue from '../../src/configuration/vue';
import { init } from '../../src';
describe('vue configuration', () => {
const platforms = ['ios', 'android'];
beforeAll(() => {
mockExistsSync();
});
afterAll(() => {
restoreExistsSync();
});
for (let platform of platforms) {
it(`for ${platform}`, () => {
init({
@ -14,4 +28,23 @@ describe('vue configuration', () => {
expect(vue(new Config()).toString()).toMatchSnapshot();
});
}
describe('with typescript', () => {
beforeAll(() => {
setHasTSConfig(true);
});
afterAll(() => {
setHasTSConfig(false);
});
for (let platform of platforms) {
it(`for ${platform}`, () => {
init({
[platform]: true,
});
expect(vue(new Config()).toString()).toMatchSnapshot();
});
}
});
});