3.4.0 • Published 5 years ago

assertz v3.4.0

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Caution

Developing now! Don't use yet.

assertz is super simple test library. Do we need toBeTruthy or toBeOdd? I need just one matcher like node.js's assert.

assertz offer only one matcher.

Getting Started

Install assertz using yarn:

yarn add --dev assertz

Or npm:

npm install --save-dev assertz

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

const sum = (a, b) => {
  return a + b;
}
module.exports = sum

Then, create a file named sum.test.js. Test file must ends with *.test.js

const assert = require('assertz')
const sum = require('./sum')

// adds 1 + 1 to equal 4
assert(sum(1, 1), 4)

Add the following section to your package.json:

{
  "scripts": {
    "test": "node ./node_modules/assertz/index.js"
  }
}

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

sum.test.js
Difference:

- 4
+ 2
3.4.0

5 years ago

3.3.0

5 years ago

3.2.0

5 years ago

3.1.0

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

1.3.0

5 years ago

2.0.0

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago