Skip to content

Commit

Permalink
tests: relative configs (#1927)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Oct 12, 2020
1 parent 5ef1e7b commit 4bfde10
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/config-lookup/relative/a.js
@@ -0,0 +1 @@
module.exports = 'a.js';
22 changes: 22 additions & 0 deletions test/config-lookup/relative/basic-config.test.js
@@ -0,0 +1,22 @@
'use strict';
const { existsSync } = require('fs');
const { resolve } = require('path');
const { run } = require('../../utils/test-utils');

describe('relative path to config', () => {
it('should work', () => {
const { stdout, stderr, exitCode } = run(__dirname, ['-c', 'webpack.config.js', '--output-path', './binary/a'], false);
expect(stderr).toBeFalsy();
expect(stdout).toBeTruthy();
expect(exitCode).toBe(0);
expect(existsSync(resolve(__dirname, './binary/a/a.bundle.js'))).toBeTruthy();
});

it('should work #2', () => {
const { stdout, stderr, exitCode } = run(__dirname, ['-c', './webpack.config.js', '--output-path', './binary/b'], false);
expect(stderr).toBeFalsy();
expect(stdout).toBeTruthy();
expect(exitCode).toBe(0);
expect(existsSync(resolve(__dirname, './binary/b/a.bundle.js'))).toBeTruthy();
});
});
9 changes: 9 additions & 0 deletions test/config-lookup/relative/webpack.config.js
@@ -0,0 +1,9 @@
const { resolve } = require('path');

module.exports = {
entry: './a.js',
output: {
path: resolve(__dirname, 'binary'),
filename: 'a.bundle.js',
},
};

0 comments on commit 4bfde10

Please sign in to comment.