Skip to content

GeonGD/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  1. 安装
npm install --save-dev jest
npm install babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime babel-preset-env

编辑package.json

{
  "scripts": {
    "test": "jest"
  }
}

编辑.babelrc

{
  "presets": ["env", "react"]
}
  1. 创建js文件
function sum(a, b) {
  return a + b;
}
export default sum;
import sum from './index'

test('adds 1 + 2 to equal 3', () => {
  expect(sum(1, 2)).toBe(3);
});
  1. 启动测试
npm test
  1. 工具安装
  • IDE:VSCode

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •