Skip to content

Commit 4dc28b2

Browse files
committed
Get Jest working with Babel
1 parent 26781e2 commit 4dc28b2

File tree

6 files changed

+4333
-1
lines changed

6 files changed

+4333
-1
lines changed

.babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env"
4+
]
5+
}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
node_modules
12
yarn-error.log

package.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,15 @@
44
"description": "A vanilla JS client for JSON API services",
55
"main": "index.js",
66
"author": "Josh Justice <[email protected]>",
7-
"license": "Apache-2.0"
7+
"license": "Apache-2.0",
8+
"scripts": {
9+
"test": "jest"
10+
},
11+
"devDependencies": {
12+
"@babel/core": "^7.1.2",
13+
"@babel/preset-env": "^7.1.0",
14+
"babel-core": "^7.0.0-0",
15+
"babel-jest": "^23.6.0",
16+
"jest": "^23.6.0"
17+
}
818
}

src/Widget.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default class Widget {
2+
3+
}

test/smoke.spec.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Widget from '../src/Widget';
2+
3+
describe('smoke test', () => {
4+
it('can handle the truth', () => {
5+
expect(true).toEqual(true);
6+
});
7+
});

0 commit comments

Comments
 (0)