Skip to content

Commit 6f8cf75

Browse files
committed
✨ 新增 jest 及 test文件
1 parent 7c5adb1 commit 6f8cf75

File tree

5 files changed

+1791
-64
lines changed

5 files changed

+1791
-64
lines changed

.circleci/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
# specify the version you desire here
6+
- image: circleci/node:latest-browsers
7+
environment:
8+
NPM_CONFIG_LOGLEVEL: error
9+
JOBS: max # https://gist.github.com/ralphtheninja/f7c45bdee00784b41fed
10+
working_directory: ~/micro-app-cli
11+
branches:
12+
ignore:
13+
- docs
14+
- gh-pages
15+
16+
steps:
17+
- checkout
18+
- restore_cache:
19+
key: micro-app-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
20+
- run: yarn --network-timeout 600000
21+
- save_cache:
22+
key: micro-app-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
23+
paths:
24+
- ./node_modules
25+
- run: yarn run test --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
26+

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
Pluggable application framework.
44

5+
[![CircleCI][CircleCI-img]][CircleCI-url]
56
[![NPM Version][npm-img]][npm-url]
67
[![NPM Download][download-img]][download-url]
78

9+
[CircleCI-img]: https://circleci.com/gh/zyao89/MicroApp-CLI/tree/master.svg?style=svg
10+
[CircleCI-url]: https://circleci.com/gh/zyao89/MicroApp-CLI/tree/master
811
[npm-img]: https://img.shields.io/npm/v/@micro-app/cli.svg?style=flat-square
912
[npm-url]: https://npmjs.org/package/@micro-app/cli
1013
[download-img]: https://img.shields.io/npm/dm/@micro-app/cli.svg?style=flat-square

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"micro-app-start": "./bin/micro-app-start.js"
1010
},
1111
"scripts": {
12-
"test": "echo \"Error: no test specified\" && exit 1"
12+
"test": "jest"
1313
},
1414
"homepage": "https://github.com/zyao89/MicroApp-CLI",
1515
"repository": {
@@ -36,13 +36,16 @@
3636
},
3737
"license": "ISC",
3838
"devDependencies": {
39+
"@types/jest": "^24.0.18",
3940
"babel-eslint": "^10.0.2",
41+
"coveralls": "^3.0.6",
4042
"eslint": "^5.16.0",
4143
"eslint-config-2o3t": "^1.1.17",
44+
"jest": "^24.9.0",
4245
"webpack": "^4.39.2"
4346
},
4447
"dependencies": {
45-
"@micro-app/core": "^0.1.1-rc.1",
48+
"@micro-app/core": "^0.1.1-rc.2",
4649
"koa": "^2.8.1",
4750
"koa-static": "^5.0.0",
4851
"opn": "^5.5.0",

src/utils/checker.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
3+
/* global expect */
4+
5+
const checker = require('./checker');
6+
7+
describe('checker', () => {
8+
9+
it('should be true', () => {
10+
expect(checker.checkNode()).toEqual(true);
11+
});
12+
});

0 commit comments

Comments
 (0)