Skip to content

Commit

Permalink
tests: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Feb 1, 2021
1 parent 40650c0 commit b19d015
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -38,7 +38,7 @@
"pretest": "yarn build && yarn lint && yarn prepsuite",
"test": "jest --reporters=default",
"test:smoketests": "nyc node smoketests",
"test:coverage": "nyc jest --forceExit",
"test:coverage": "nyc --require ts-node/register jest --forceExit",
"test:cli": "jest test --reporters=default --forceExit",
"test:packages": "jest packages/ --reporters=default --forceExit",
"test:ci": "yarn test:cli && yarn test:packages",
Expand Down
@@ -1,14 +1,11 @@
const { run } = require('../../utils/test-utils');
const { existsSync } = require('fs');
const { resolve } = require('path');

describe('webpack cli', () => {
it('should support typescript file', () => {
const { exitCode, stderr, stdout } = run(__dirname, ['-c', './webpack.config.ts']);
it('should support CommonJS file', () => {
const { exitCode, stderr, stdout } = run(__dirname, ['-c', 'webpack.config.cjs'], false);

expect(exitCode).toBe(0);
expect(stderr).toBeFalsy();
expect(stdout).toBeTruthy();
expect(exitCode).toBe(0);
expect(existsSync(resolve(__dirname, 'dist/foo.bundle.js'))).toBeTruthy();
});
});
1 change: 1 addition & 0 deletions test/config-format/commonjs-default/main.js
@@ -0,0 +1 @@
console.log('Hoshiumi');
12 changes: 12 additions & 0 deletions test/config-format/commonjs-default/webpack.config.cjs
@@ -0,0 +1,12 @@
const path = require('path');

const config = {
mode: 'production',
entry: './main.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'foo.bundle.js',
},
};

module.exports.default = config;
14 changes: 0 additions & 14 deletions test/config-format/typescript-commonjs-default/webpack.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion test/config-format/typescript-commonjs/main.ts

This file was deleted.

5 changes: 0 additions & 5 deletions test/config-format/typescript-commonjs/tsconfig.json

This file was deleted.

File renamed without changes.
File renamed without changes.

0 comments on commit b19d015

Please sign in to comment.