Skip to content
This repository was archived by the owner on May 31, 2020. It is now read-only.

Commit 9a05212

Browse files
committed
test: add test script
1 parent 1f08c20 commit 9a05212

File tree

3 files changed

+217
-2
lines changed

3 files changed

+217
-2
lines changed

package-lock.json

Lines changed: 206 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"@babel/preset-env": "^7.1.0",
88
"@babel/preset-flow": "^7.0.0",
99
"@babel/preset-react": "^7.0.0",
10+
"@babel/register": "^7.0.0",
1011
"babel-eslint": "^10.0.1",
12+
"chai": "^4.2.0",
1113
"eslint": "^5.6.1",
1214
"eslint-config-prettier": "^3.1.0",
1315
"eslint-config-react": "^1.1.7",
@@ -25,12 +27,14 @@
2527
"flow-typed": "^2.5.1",
2628
"husky": "^1.1.1",
2729
"lerna": "^3.4.1",
30+
"mocha": "^5.2.0",
2831
"prettier": "^1.14.3",
2932
"prettier-eslint": "^8.8.2",
3033
"prettier-eslint-cli": "^4.7.1",
3134
"to-fast-properties": "^2.0.0"
3235
},
3336
"scripts": {
37+
"test": "./node_modules/.bin/mocha --require @babel/register \"./packages/*/!(node_modules)/**/__test__/*.js\"",
3438
"eslint-check": "eslint --print-config . | eslint-config-prettier-check",
3539
"docs": "./node_modules/.bin/gitbook serve",
3640
"storybook": "start-storybook -p 9001 -c .storybook",

packages/utils/src/__test__/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import {
55
convertFromRaw,
66
SelectionState,
77
} from 'draft-js'
8-
import { getCharCount, getWordCount, getLineCount, hasEntity, getCurrentEntityKey } from '../index'
8+
import {
9+
getCharCount,
10+
getWordCount,
11+
getLineCount,
12+
hasEntity,
13+
getCurrentEntityKey,
14+
} from '../index'
915

1016
describe('Entity', () => {
1117
const createEditorStateFromRaw = raw => {

0 commit comments

Comments
 (0)