Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Jul 22, 2021
1 parent 2e2446b commit 4fda813
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/plugin/webpack/test/AssetRelocatorPatch_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('AssetRelocatorPatch', () => {
});

describe('Production', () => {
const generator = new WebpackConfigGenerator(config, appPath, true, 3000);
let generator = new WebpackConfigGenerator(config, appPath, true, 3000);

it('builds main', async () => {
const mainConfig = generator.getMainConfig();
Expand Down Expand Up @@ -225,5 +225,20 @@ describe('AssetRelocatorPatch', () => {
expect(output).to.contain('Hello, world! from the preload');
expect(output).to.contain('Hello, world! from the renderer');
});

it('builds renderer with nodeIntegration = false', async () => {
config.renderer.nodeIntegration = false;
generator = new WebpackConfigGenerator(config, appPath, true, 3000);

const rendererConfig = await generator.getRendererConfig(config.renderer.entryPoints);
await asyncWebpack(rendererConfig);

await expectOutputFileToHaveTheCorrectNativeModulePath({
outDir: rendererOut,
jsPath: path.join(rendererOut, 'main_window/index.js'),
nativeModulesString: '.ab="/native_modules/"',
nativePathString: `.ab+"${nativePathSuffix}"`,
});
});
});
});

0 comments on commit 4fda813

Please sign in to comment.