Skip to content

Commit

Permalink
test(plugin-webpack): remove problematic exits-early test
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Jul 11, 2021
1 parent ca11c06 commit 5a81430
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions packages/plugin/webpack/test/WebpackPlugin_spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from 'chai';
import { ForgeConfig } from '@electron-forge/shared-types';
import * as fs from 'fs-extra';
import * as os from 'os';
import * as path from 'path';
import { tmpdir } from 'os';

import { WebpackPluginConfig } from '../src/Config';
import WebpackPlugin from '../src/WebpackPlugin';
Expand All @@ -16,7 +16,7 @@ describe('WebpackPlugin', () => {
},
};

const webpackTestDir = path.resolve(tmpdir(), 'electron-forge-plugin-webpack-test');
const webpackTestDir = path.resolve(os.tmpdir(), 'electron-forge-plugin-webpack-test');

describe('TCP port', () => {
it('should fail for privileged ports', () => {
Expand Down Expand Up @@ -107,39 +107,4 @@ describe('WebpackPlugin', () => {
});
});
});

describe('WebpackDevServer', () => {
let plugin: WebpackPlugin;
const webpackDevServerConfig: WebpackPluginConfig = {
mainConfig: {
entry: './foo/main.js',
},
renderer: {
config: {},
entryPoints: [
{
js: './foo/main.js',
name: 'main_window',
},
],
},
};
const mainFile = path.join(webpackTestDir, 'main', 'index.js');
const rendererFile = path.join(webpackTestDir, 'renderer', 'main_window', 'index.js');
before(async () => {
plugin = new WebpackPlugin(webpackDevServerConfig);
plugin.setDirectories(webpackTestDir);
await plugin.startLogic();
});

after(async () => {
plugin.exitHandler({ cleanup: true, exit: true });
await fs.remove(webpackTestDir);
});

it('writesToDisk', async () => {
expect(await fs.pathExists(mainFile)).to.equal(true);
expect(await fs.pathExists(rendererFile)).to.equal(true);
});
});
});

0 comments on commit 5a81430

Please sign in to comment.