Skip to content

Commit

Permalink
test: config CI
Browse files Browse the repository at this point in the history
  • Loading branch information
muzea committed Feb 28, 2019
1 parent dc3068f commit 824a8b6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ sample-dist
benchmark-dist
yarn.lock
node_modules
coverage.lcov
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language:
node_js
node_js:
- "10"
install:
- npm install
script:
- npm run lint
- npm run test
- npm run report-coverage
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 使用高阶函数开发语法分析器

[![travis-ci](https://api.travis-ci.org/muzea/parser.svg?branch=master)](https://travis-ci.org/muzea/parser) [![codecov](https://img.shields.io/codecov/c/github/muzea/parser/master.svg)](https://codecov.io/gh/muzea/parser)

程序是[轮子哥博客](http://www.cppblog.com/vczh/archive/2008/05/21/50656.html)的js复刻版。

做了一些修改方便理解。~~其实是我看不懂轮子脚本的语法了~~
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"test": "nyc ava --color",
"lint": "yarn tslint -p . && yarn eslint sample/*.js && yarn tslint sample/*.ts",
"benchmark": "node ./benchmark-dist/json.js",
"benchmark:build": "parcel build benchmark/* -d benchmark-dist --target node"
"benchmark:build": "parcel build benchmark/* -d benchmark-dist --target node",
"report-coverage": "nyc ava --color && nyc report --reporter=text-lcov > coverage.lcov && codecov"
},
"nyc": {
"include": [
Expand All @@ -26,6 +27,7 @@
"devDependencies": {
"ava": "1.2",
"benchmark": "^2.1.4",
"codecov": "^3.2.0",
"eslint": "^5.9.0",
"eslint-plugin-prettier": "^3.0.0",
"microtime": "^2.1.8",
Expand Down
2 changes: 1 addition & 1 deletion sample/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ function hexToValue(obj: Item): string {

const codeMap = {
'"': '\"',
'\\': '\\',
'/': '\/',
'\\': '\\',
'b': '\b',
'n': '\n',
'r': '\r',
Expand Down

0 comments on commit 824a8b6

Please sign in to comment.