Skip to content

Commit

Permalink
add basic passing test
Browse files Browse the repository at this point in the history
juliangruber committed Mar 23, 2022

Verified

This commit was signed with the committer’s verified signature.
panicstevenson Panic Stevenson
1 parent 7d90537 commit ffe6e8e
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"license": "MIT",
"repository": "juliangruber/node-core-test",
"scripts": {
"test": "prettier-standard && standard"
"test": "prettier-standard && standard && node test"
},
"devDependencies": {
"prettier-standard": "^16.4.1",
21 changes: 21 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict'

const assert = require('assert')
const test = require('.')

test('synchronous passing test', t => {
// This test passes because it does not throw an exception.
assert.strictEqual(1, 1)
})

test('asynchronous passing test', async t => {
// This test passes because the Promise returned by the async
// function is not rejected.
assert.strictEqual(1, 1)
})

test('callback passing test', (t, done) => {
// done() is the callback function. When the setImmediate() runs, it invokes
// done() with no arguments.
setImmediate(done)
})

0 comments on commit ffe6e8e

Please sign in to comment.