tjent

1.0.1 • Public • Published

tjent

Minimize time writing Javascript test boilerplate.

Features:

  • Generate Jasmine test boilerplate
    • Class export w/ identifier
    • Class export
    • Function export w/ identifier
    • Named function export
    • Function export
    • React/JSX component export w/ identifier
    • Named React/JSX component export w/ identifier
    • React/JSX component export
    • React/JSX pure component export w/ identifier
    • Named React/JSX pure component export
    • React/JSX pure component export
  • Generate other test frameworks (tape)

install

$ npm install -g tjent

usage

cli

$ tjent tests/fixtures/class-export-identifier.js
import Klass from tests/fixtures/class-export-identifier.js

describe('Klass', () => {
  it('does stuff', () => {
    const klass = new Klass()
    expect(klass).toBeTruthy()
    expect('Test to have been written').toEqual(true)
  })
})

api

const path = 'path/to/file'
tjent({
  path
}).then((output) => {
  log(`### start - ${fixtureType} ########################################`)
  log(output)
  t.ok(fixture, `Successfully parsed ${fixtureType} @ ${fixture}`)
  log(`### end - ${fixtureType} ########################################`)
  log('')
}).catch((err) => {
  console.error(err)
  t.fail('', '', err)
  process.exit(1)
})

Readme

Keywords

none

Package Sidebar

Install

npm i tjent

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • feltnerm