@nokkel/testing
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

Nokkel Testing Library

A typescript testing library for Koa APIs or Cypress e2e testing. This library provides useful helper Typescript Jest configuration, functions and classes for mocking and generating values for your tests.

Using this library

You can install this library using the following command

npm add -D @nokkel/testing jest jest-junit ts-jest ts-node

It is also recommended to install the following typing for your typescript project

npm add -D @types/jsonwebtoken @types/jest @types/koa @types/node

Once installed you can configure Jest by adding the following files to your project

jest.config.ts

import type { Config } from 'jest';
import { pathsToModuleNameMapper } from 'ts-jest';

import baseConfig from '@nokkel/testing/dist/jest.config';

import { compilerOptions } from './tsconfig.json';

const config: Config = {
  ...baseConfig,
  moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
  modulePaths: [compilerOptions.baseUrl],
};

export default config;

Package Sidebar

Install

npm i @nokkel/testing

Weekly Downloads

70

Version

0.0.0

License

MIT

Unpacked Size

56 kB

Total Files

37

Last publish

Collaborators

  • nokkel-developer
  • rdder
  • chrisddonaldson_nokkel
  • cshaw
  • monikamistry_nokkel
  • curtishuangnokkel