1.0.7 • Published 5 years ago

mjstest v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

mjstest - A test runner for .mjs projects

Important: beforeEach, afterEach, beforeAll and afterAll is not yet implemented

We are at the point where we can use .mjs under the --experimental-modules flag. The implementation may still change, but it's unlikely. I wanted a testframework that was mjs-first instead of relying on babel.

Interface

The globals exposed by the library are inspired by Jasmine.

describe('hello world', () => {
  beforeEach(async () => {
    // ...
  })

  afterEach(async () => {
    // ...
  })

  beforeAll(async () => {
    // ...
  })

  afterAll(async () => {
    // ...
  })

  it('can run a test', async () => {
  })

  test('test === it', () => {
    expect(test).toBe(it)
  })
})

Usage

mjstest **/*.spec.mjs
1.0.7

5 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago