mirror of
https://github.com/kou029w/jest-hands-on.git
synced 2025-01-31 14:07:58 +00:00
support esm
This commit is contained in:
parent
cb86323913
commit
997b123506
6 changed files with 2669 additions and 4545 deletions
3
babel.config.json
Normal file
3
babel.config.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"presets": ["@parcel/babel-preset"]
|
||||||
|
}
|
|
@ -3,13 +3,15 @@
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "CC0-1.0",
|
"license": "CC0-1.0",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"start": "parcel index.html --open",
|
"start": "parcel index.html --open",
|
||||||
"build": "parcel build index.html"
|
"build": "parcel build index.html"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jest": "^27.0.6",
|
"@parcel/babel-preset": "^2.0.0-alpha.2",
|
||||||
"parcel": "^2.0.0-beta.3.1"
|
"jest": "^27.5.1",
|
||||||
|
"parcel": "^2.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4
renovate.json
Normal file
4
renovate.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"extends": ["config:base", "config:semverAllMonthly"],
|
||||||
|
"automerge": true
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
/** @license https://github.com/facebook/jest/blob/master/LICENSE */
|
|
||||||
|
|
||||||
function sum(a, b) {
|
function sum(a, b) {
|
||||||
return a + b;
|
return a + b;
|
||||||
}
|
}
|
||||||
module.exports = sum;
|
|
||||||
|
export default sum;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
/** @license https://github.com/facebook/jest/blob/master/LICENSE */
|
import sum from "./sum";
|
||||||
|
|
||||||
const sum = require("./sum");
|
test("1 と 2 の合計は 3", () => {
|
||||||
|
|
||||||
test("adds 1 + 2 to equal 3", () => {
|
|
||||||
expect(sum(1, 2)).toBe(3);
|
expect(sum(1, 2)).toBe(3);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue