mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00
33 lines
717 B
TypeScript
33 lines
717 B
TypeScript
import { __react } from '@nativescript/webpack';
|
|
|
|
// todo: maybe mock baseConfig as we test it separately?
|
|
// import Config from 'webpack-chain'
|
|
// jest.mock('../../src/configuration/base', () => () => {
|
|
// return new Config()
|
|
// })
|
|
|
|
describe('react configuration', () => {
|
|
const platforms = ['ios', 'android'];
|
|
|
|
for (let platform of platforms) {
|
|
describe(`> ${platform} >`, () => {
|
|
it(`base config`, () => {
|
|
expect(
|
|
__react({
|
|
[platform]: true,
|
|
}).toString()
|
|
).toMatchSnapshot();
|
|
});
|
|
|
|
it(`adds ReactRefreshWebpackPlugin when HMR enabled`, () => {
|
|
expect(
|
|
__react({
|
|
[platform]: true,
|
|
hmr: true,
|
|
}).toString()
|
|
).toMatchSnapshot();
|
|
});
|
|
});
|
|
}
|
|
});
|