Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: moar tests
  • Loading branch information
mjhenkes committed Jul 15, 2019
commit 98de7b43f54a8db4c06bafa4bf7852e11ba81895
44 changes: 44 additions & 0 deletions test/IgnoreOrder.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import path from 'path';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename file ignoreOrder-option.test.js

import webpack from 'webpack';

describe('IgnoreOrder', () => {
it('should emit errors', (done) => {
const casesDirectory = path.resolve(__dirname, 'cases');
const directoryForCase = path.resolve(casesDirectory, 'ignoreOrderFalse');
// eslint-disable-next-line import/no-dynamic-require, global-require
const webpackConfig = require(path.resolve(
directoryForCase,
'webpack.config.js'
));
const compiler = webpack({
...webpackConfig,
mode: 'development',
context: directoryForCase,
cache: false,
});
compiler.run((err1, stats) => {
expect(stats.hasWarnings()).toBeTruthy();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toBe(true)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wondering why toBeTruthy(); is "better". Seems like the exact same shit to me...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done();
});
});

it('should not emit errors', (done) => {
const casesDirectory = path.resolve(__dirname, 'cases');
const directoryForCase = path.resolve(casesDirectory, 'ignoreOrder');
// eslint-disable-next-line import/no-dynamic-require, global-require
const webpackConfig = require(path.resolve(
directoryForCase,
'webpack.config.js'
));
const compiler = webpack({
...webpackConfig,
mode: 'development',
context: directoryForCase,
cache: false,
});
compiler.run((err1, stats) => {
expect(stats.hasWarnings()).toBeFalsy();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toBe(false)

done();
});
});
});