mirror of
				https://github.com/NativeScript/NativeScript.git
				synced 2025-11-04 21:06:45 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			622 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			622 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import Config from 'webpack-chain';
 | 
						|
 | 
						|
import react from '../../src/configuration/react';
 | 
						|
import { init } from '../../src';
 | 
						|
 | 
						|
describe('react configuration', () => {
 | 
						|
	const platforms = ['ios', 'android'];
 | 
						|
 | 
						|
	for (let platform of platforms) {
 | 
						|
		describe(`> ${platform} >`, () => {
 | 
						|
			it(`base config`, () => {
 | 
						|
				init({
 | 
						|
					[platform]: true,
 | 
						|
				});
 | 
						|
				expect(react(new Config()).toString()).toMatchSnapshot();
 | 
						|
			});
 | 
						|
 | 
						|
			it(`adds ReactRefreshWebpackPlugin when HMR enabled`, () => {
 | 
						|
				init({
 | 
						|
					[platform]: true,
 | 
						|
					hmr: true,
 | 
						|
				});
 | 
						|
				expect(react(new Config()).toString()).toMatchSnapshot();
 | 
						|
			});
 | 
						|
		});
 | 
						|
	}
 | 
						|
});
 |