Skip to content
Permalink
Browse files

chore: about jest

  • Loading branch information
simonwong committed Dec 26, 2019
1 parent 0aab814 commit 9bbe5b1585ab709b8e0c1ad0ff8243b7c43b7bd7
Showing with 3,121 additions and 50 deletions.
  1. +4 −0 .eslintrc.js
  2. +4 −0 jest.config.js
  3. +5 −0 package.json
  4. +2 −2 src/index.ts
  5. +13 −0 test/index.test.ts
  6. +3,093 −48 yarn.lock
@@ -3,9 +3,11 @@ const eslintrc = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
],
plugins: [
'@typescript-eslint',
'jest',
],
env: {
browser: true,
@@ -43,6 +45,8 @@ const eslintrc = {
}], // 成员分隔符
'@typescript-eslint/semi': ['error', 'never'],

'jest/expect-expect': ["off"],

'space-infix-ops': ['error'],
'comma-dangle': ['error', {
'arrays': 'always-multiline',
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
}
@@ -14,20 +14,25 @@
},
"homepage": "https://github.com/simonwong/fly-helper#readme",
"scripts": {
"test": "jest --coverage --verbose -u",
"lint": "eslint --ext .js,.ts ./src",
"lint:fix": "eslint --fix --ext .js,.ts ./src"
},
"devDependencies": {
"@babel/preset-env": "^7.7.7",
"@types/jest": "^24.0.24",
"@typescript-eslint/eslint-plugin": "^2.13.0",
"@typescript-eslint/parser": "^2.13.0",
"eslint": "^6.8.0",
"eslint-plugin-jest": "^23.1.1",
"jest": "^24.9.0",
"rollup": "^1.27.14",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-eslint": "^7.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-typescript2": "^0.25.3",
"ts-jest": "^24.2.0",
"typescript": "^3.7.4"
},
"dependencies": {
@@ -1,3 +1,3 @@
export default function myFirstFunc () {
return 'hello rollup'
export default function myFirstFunc (str: string) {
return `hello ${str}`
}
@@ -0,0 +1,13 @@
import assert from 'assert'
import myFirstFunc from '../src'

describe('validate:', () => {
/**
* myFirstFunc
*/
describe('myFirstFunc', () => {
test(' return hello rollup ', () => {
assert.strictEqual(myFirstFunc('rollup'), 'hello rollup')
})
})
})

0 comments on commit 9bbe5b1

Please sign in to comment.
You can’t perform that action at this time.