Skip to content

Commit fe48bdf

Browse files
committed
refactor: remove jest
1 parent 8a80b4b commit fe48bdf

9 files changed

+382
-4449
lines changed

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
language: node_js
2-
node_js: stable
2+
node_js: 10
33
cache: yarn
4-
after_success: npx codecov
4+
scripts:
5+
- yarn test
6+
- yarn prepack

package.json

+9-40
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,29 @@
44
"license": "MIT",
55
"description": "Old fashioned CSS-in-JS",
66
"author": "Eric Liu (https://github.com/metonym)",
7-
"main": "lib/index.js",
8-
"types": "lib/index.d.ts",
7+
"main": "lib/colonial.js",
8+
"types": "lib/colonial.d.ts",
99
"scripts": {
10-
"develop": "tsc -w",
11-
"build": "tsc",
12-
"lint": "tslint --fix -p . -c tslint.json",
13-
"test": "jest --coverage",
14-
"test:tdd": "jest --watch",
15-
"prepublishOnly": "yarn build"
10+
"test": "tsnd src/*.test.ts",
11+
"test:tdd": "tsnd --respawn src/*.test.ts",
12+
"prepack": "tsc"
1613
},
1714
"devDependencies": {
18-
"@commitlint/cli": "^8.2.0",
19-
"@commitlint/config-conventional": "^8.2.0",
20-
"@types/jest": "^25.1.1",
21-
"husky": "^4.2.1",
22-
"jest": "^25.2.4",
23-
"prettier": "^2.0.2",
24-
"pretty-quick": "^2.0.0",
25-
"ts-jest": "^25.3.0",
26-
"tslint": "^6.0.0",
27-
"tslint-config-prettier": "^1.18.0",
15+
"@types/node": "^13.13.4",
16+
"ts-node-dev": "^1.0.0-pre.44",
2817
"typescript": "^3.6.3"
2918
},
30-
"husky": {
31-
"hooks": {
32-
"pre-commit": "yarn lint && pretty-quick --staged",
33-
"pre-push": "yarn test",
34-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
35-
}
36-
},
37-
"prettier": {
38-
"tabWidth": 2,
39-
"semi": true,
40-
"singleQuote": true
41-
},
42-
"jest": {
43-
"preset": "ts-jest"
44-
},
45-
"commitlint": {
46-
"extends": [
47-
"@commitlint/config-conventional"
48-
]
49-
},
5019
"repository": {
5120
"type": "git",
5221
"url": "https://github.com/metonym/colonial.git"
5322
},
5423
"homepage": "https://github.com/metonym/colonial",
24+
"bugs": "https://github.com/metonym/colonial/issues",
5525
"keywords": [
5626
"css-in-js",
5727
"template literal"
5828
],
5929
"files": [
6030
"lib"
61-
],
62-
"bugs": "https://github.com/metonym/colonial/issues"
31+
]
6332
}

src/colonial.test.ts

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { strict as test } from "assert";
2+
import { css, sheet, style } from "./colonial";
3+
4+
// @ts-ignore
5+
test.equal(css(), undefined);
6+
test.deepEqual(style({}), {});
7+
test.deepEqual(
8+
css`
9+
color: red;
10+
`,
11+
"_0"
12+
);
13+
14+
test.equal(sheet().length, 1);
15+
16+
test.equal(
17+
css`
18+
color: red;
19+
background-color: blue;
20+
border-bottom-width: 4px;
21+
`,
22+
"_1"
23+
);
24+
25+
test.equal(sheet().length, 2);
26+
27+
test.deepEqual(
28+
style({
29+
color: "red",
30+
backgroundColor: "blue",
31+
}),
32+
{
33+
_2: {
34+
backgroundColor: "blue",
35+
color: "red",
36+
},
37+
}
38+
);
39+
test.equal(sheet().length, 3);
40+
test.equal(css``, undefined);
41+
test.equal(sheet().length, 3);

src/index.ts src/colonial.ts

File renamed without changes.

tests/__snapshots__/colonial.spec.ts.snap

-24
This file was deleted.

tests/colonial.spec.ts

-39
This file was deleted.

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"strict": true,
99
"target": "es5"
1010
},
11-
"include": ["src"]
11+
"include": ["src"],
12+
"exclude": ["src/*.test.ts"]
1213
}

tslint.json

-4
This file was deleted.

0 commit comments

Comments
 (0)