Skip to content

Commit 3862bb9

Browse files
committed
Compile test file in build stage
1 parent 3e78ff0 commit 3862bb9

File tree

10 files changed

+30
-109
lines changed

10 files changed

+30
-109
lines changed

.babelrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.babelrc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', {
4+
forceAllTransforms: true,
5+
modules: 'cjs',
6+
debug: false,
7+
useBuiltIns: 'usage',
8+
}],
9+
],
10+
exclude: 'node_modules/**',
11+
plugins: [
12+
['@babel/plugin-transform-runtime', {
13+
helpers: false,
14+
polyfill: true,
15+
regenerator: false,
16+
}],
17+
],
18+
};

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ dist
22
coverage
33
examples
44
node_modules
5-
*.gitignore*
5+
*.gitignore*
6+
test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ jspm_packages
3939
# Build artifacts
4040
dist
4141

42+
# Test folder, because tests are compiled
43+
test/*
44+
4245
*.gitignore*

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- &node
2020
stage: test
21-
script: bash .travis/script.sh install test
21+
script: bash .travis/script.sh install build test
2222
node_js: '8'
2323

2424
- <<: *node

package-lock.json

Lines changed: 0 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"browser": "./umd.js",
1717
"scripts": {
1818
"lint": "eslint . && echo \"eslint: no lint errors\"",
19-
"build": "rollup -c rollup.config.js",
19+
"build": "rollup -c rollup.config.js && babel test-src --out-dir test",
2020
"build:watch": "rollup -c rollup.config.js --watch",
21-
"test": "mocha --require @babel/register -R spec -b",
21+
"test": "mocha -R spec -b",
2222
"coverage": "nyc npm test",
2323
"coveralls": "nyc report --reporter=text-lcov | coveralls"
2424
},

rollup.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default [
2525
],
2626
plugins: [
2727
babel({
28+
babelrc: false,
2829
presets: [
2930
[('@babel/preset-env'), {
3031
forceAllTransforms: true,
@@ -76,6 +77,7 @@ export default [
7677
],
7778
plugins: [
7879
babel({
80+
babelrc: false,
7981
presets: [
8082
[('@babel/preset-env'), {
8183
forceAllTransforms: true,
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
module.exports = {
2-
extends: ['../.eslintrc.js'],
32
plugins: [
43
'mocha',
54
],
@@ -10,4 +9,4 @@ module.exports = {
109
'no-sparse-arrays': 'off',
1110
'import/first': 'off',
1211
},
13-
};
12+
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import { Readable } from 'stream';
33
import expect from 'expect.js';
4-
import JsonStreamStringify from '../src/JsonStreamStringify';
4+
import JsonStreamStringify from '..';
55

66
function createTest(input, expected, ...args) {
77
return () => new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)