Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
added another test for ecma option
Browse files Browse the repository at this point in the history
  • Loading branch information
hulkish committed Jul 20, 2017
1 parent 62211e3 commit 5d1ffea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"scripts": {
"start": "npm run build -- -w",
"build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js",
"build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js'",
"test:all": "npm run test:coverage && npm run test:lint",
"test": "jest",
"test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { SourceMapConsumer } from 'source-map';
import { SourceMapSource, RawSource, ConcatSource } from 'webpack-sources';
import RequestShortener from 'webpack/lib/RequestShortener';
import ModuleFilenameHelpers from 'webpack/lib/ModuleFilenameHelpers';
import Uglify from './uglify';
import validateOptions from 'schema-utils';
import schema from '../options.json';
import Uglify from './uglify';

/* eslint-disable
no-param-reassign
Expand All @@ -21,7 +21,7 @@ class UglifyJsPlugin {
constructor(options = {}) {
validateOptions(schema, options, 'UglifyJs Plugin');

const = {
const {
uglifyOptions = {},
test = /\.js$/i,
warningsFilter = () => true,
Expand Down
4 changes: 4 additions & 0 deletions test/invalid-options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ describe('when applied with invalid options', () => {
new UglifyJsPlugin({ uglifyOptions: { emca: 8 } });
}).not.toThrow();

expect(() => {
new UglifyJsPlugin({ uglifyOptions: { ecma: 7.5 } });
}).toThrow('should be integer');

expect(() => {
new UglifyJsPlugin({ uglifyOptions: { ecma: true } });
}).toThrow('should be integer');
Expand Down

0 comments on commit 5d1ffea

Please sign in to comment.