git ssb

0+

mixmix / ssb-testing-guide



Tree: 72d0ca267b25fc69c2110d38eb618f2be74a6cc8

Files: 72d0ca267b25fc69c2110d38eb618f2be74a6cc8 / basic / ex1 / index.test.js

453 bytesRaw
1const test = require('tape')
2
3test('[Basic] Exercise 1 - Hello World', t => {
4 t.equal(2 + 2, 4, "basic addition works!")
5 t.end()
6})
7
8test('[Basic] Exercise 1 - Async hello world', t => {
9 t.plan(1)
10 setTimeout(() => {
11 t.equal(2 + 2, 4, "basic addition works!")
12 // Could put t.end here alternatively!
13 })
14})
15
16test('[Basic] Exercise 1 - Throws hello world', t => {
17 t.plan(1)
18 t.throws(() => {
19 throw new Error("Hello world!")
20 })
21})
22

Built with git-ssb-web