Skip to content

muhammad-bin-zafar/async-test-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

async-test-runner-logo

Prelude

Tests are inevitable to continuous integration and continuous delivery. Writing tests in ESM JavaScript with top-level async/await can be tricky. Especially in the case where we might want to maintain a sequence of tests. The implementation is more of a concept, than an attempt replace mocha or jest or AVA.

A simple test suite:

const $ = new Suite('Math')

$.it('adds', _ => expect(2+1).equals(3))

await $.it('adds async', async _ => {
  const req = await fetch('http://api.mathjs.org/v4/?expr=1%2B2')
  const result = await result.text()
  expect(result).equals('3')
})

$.done()

Features

  • Simplicity
  • Works for pure ESM TypeScript
  • Batteries included i.e. expect is provided with plugins:
    • chai-http
    • chai-array
    • chai-sorted, etc

About

An over-simplified async test runner.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published