Skip to content

Commit

Permalink
refactor: move unbundled regenerator test to build-options
Browse files Browse the repository at this point in the history
- I accidentally put it into build-default before build-options existed,
  but the test very specifically tests an option, `--target node`, so
  it should be in build-options as that's not a zero-config default
  • Loading branch information
agilgur5 committed Oct 14, 2020
1 parent 64c5094 commit 6ad18ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 0 additions & 8 deletions test/e2e/tsdx-build-default.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ describe('tsdx build :: zero-config defaults', () => {
expect(matched).toBeTruthy();
});

it('should not bundle regeneratorRuntime when targeting Node', () => {
const output = execWithCache('node ../dist/index.js build --target node');
expect(output.code).toBe(0);

const matched = grep(/regeneratorRuntime = r/, ['dist/build-default.*.js']);
expect(matched).toBeFalsy();
});

it('should use lodash for the CJS build', () => {
const output = execWithCache('node ../dist/index.js build');
expect(output.code).toBe(0);
Expand Down
10 changes: 9 additions & 1 deletion test/e2e/tsdx-build-options.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as shell from 'shelljs';

import * as util from '../utils/fixture';
import { execWithCache } from '../utils/shell';
import { execWithCache, grep } from '../utils/shell';

shell.config.silent = false;

Expand Down Expand Up @@ -47,6 +47,14 @@ describe('tsdx build :: options', () => {
expect(output.code).toBe(0);
});

it('should not bundle regeneratorRuntime when targeting Node', () => {
const output = execWithCache('node ../dist/index.js build --target node');
expect(output.code).toBe(0);

const matched = grep(/regeneratorRuntime = r/, ['dist/build-default.*.js']);
expect(matched).toBeFalsy();
});

afterAll(() => {
util.teardownStage(stageName);
});
Expand Down

0 comments on commit 6ad18ba

Please sign in to comment.