8000 GitHub - rahulrk-dev/testme: Testing CLI tool to test JavaScript Apps
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rahulrk-dev/testme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TestMe

Testing CLI tool to test javascript apps

Getting Started

To install testme, type

$ git clone https://github.com/DevTMK/testme.git
$ cd testme
$ npm install
$ npm link

Then run this command inside a project folder

$ testme

Usage

Let's get started by writing a test for a function that adds two numbers. First, create a add.js file:

function add(a, b) {
	return a + b
}
module.exports = add

Then, create a file named add.test.js. This will contain our actual test:

const add = require('./add')

test('adds 1 + 2 to equal 3', () => {
	expect(add(1, 2)).toBe(3)
})

Add the following section to your package.json:

"scripts": {
	// ...
	"test": "testme"
}

Finally, run npm run test or yarn test and it will print this message:

 RUNS  add.test.js
✔ adds 1 + 2 to equal 3
44CE

About

Testing CLI tool to test JavaScript Apps

Resources

Stars

Watchers

Forks

0