Skip to content

Commit

Permalink
test: fix parallel testing, reenable
Browse files Browse the repository at this point in the history
  • Loading branch information
forivall committed Jan 20, 2022
1 parent 27f1d34 commit 5eefb66
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion .taprc
@@ -1,2 +1 @@
jobs: 1
test-ignore: (\/|^)test/(helpers|fixtures)\/
10 changes: 5 additions & 5 deletions test/html-webpack-plugin-as-argument.test.js
Expand Up @@ -8,15 +8,15 @@ const DynamicCdnWebpackPlugin = require('..').default;
const runWebpack = require('./helpers/run-webpack.js');
const cleanDir = require('./helpers/clean-dir.js');

t.test('html-webpack-plugin', async t => {
await cleanDir(path.resolve(__dirname, './fixtures/output/html-webpack-plugin'));
t.test('html-webpack-plugin-as-argument', async t => {
await cleanDir(path.resolve(__dirname, './fixtures/output/html-webpack-plugin-as-argument'));

await runWebpack({
context: path.resolve(__dirname, './fixtures/app'),

output: {
publicPath: '/',
path: path.resolve(__dirname, './fixtures/output/html-webpack-plugin'),
path: path.resolve(__dirname, './fixtures/output/html-webpack-plugin-as-argument'),
},

entry: {
Expand All @@ -26,12 +26,12 @@ t.test('html-webpack-plugin', async t => {
plugins: [new HtmlWebpackPlugin(), new DynamicCdnWebpackPlugin({}, HtmlWebpackPlugin)],
});

const indexFile = await fs.readFile(path.resolve(__dirname, './fixtures/output/html-webpack-plugin/index.html'), { encoding: 'utf-8' });
const indexFile = await fs.readFile(path.resolve(__dirname, './fixtures/output/html-webpack-plugin-as-argument/index.html'), { encoding: 'utf-8' });

t.ok(indexFile.includes('src="/app.js"'));
t.ok(indexFile.includes('src="https://unpkg.com/react@15.6.1/dist/react.js"'));

const output = await fs.readFile(path.resolve(__dirname, './fixtures/output/html-webpack-plugin/app.js'));
const output = await fs.readFile(path.resolve(__dirname, './fixtures/output/html-webpack-plugin-as-argument/app.js'));

// NOTE: not inside t.notOk to prevent ava to display whole file in console
const doesIncludeReact = output.includes('PureComponent');
Expand Down
10 changes: 5 additions & 5 deletions test/no-html-webpack-plugin.test.js
Expand Up @@ -8,15 +8,15 @@ const DynamicCdnWebpackPlugin = require('..').default;
const runWebpack = require('./helpers/run-webpack.js');
const cleanDir = require('./helpers/clean-dir.js');

t.test('html-webpack-plugin', async t => {
await cleanDir(path.resolve(__dirname, './fixtures/output/html-webpack-plugin'));
t.test('no-html-webpack-plugin', async t => {
await cleanDir(path.resolve(__dirname, './fixtures/output/no-html-webpack-plugin'));

await runWebpack({
context: path.resolve(__dirname, './fixtures/app'),

output: {
publicPath: '/',
path: path.resolve(__dirname, './fixtures/output/html-webpack-plugin'),
path: path.resolve(__dirname, './fixtures/output/no-html-webpack-plugin'),
},

entry: {
Expand All @@ -30,12 +30,12 @@ t.test('html-webpack-plugin', async t => {
],
});

const indexFile = await fs.readFile(path.resolve(__dirname, './fixtures/output/html-webpack-plugin/index.html'), { encoding: 'utf-8' });
const indexFile = await fs.readFile(path.resolve(__dirname, './fixtures/output/no-html-webpack-plugin/index.html'), { encoding: 'utf-8' });

t.ok(indexFile.includes('src="/app.js"'));
t.ok(!indexFile.includes('src="https://unpkg.com/react@15.6.1/dist/react.js"'));

const output = await fs.readFile(path.resolve(__dirname, './fixtures/output/html-webpack-plugin/app.js'));
const output = await fs.readFile(path.resolve(__dirname, './fixtures/output/no-html-webpack-plugin/app.js'));

// NOTE: not inside t.notOk to prevent ava to display whole file in console
const doesIncludeReact = output.includes('PureComponent');
Expand Down

0 comments on commit 5eefb66

Please sign in to comment.