@nosaid/jest

0.0.4 • Public • Published

@nosaid/jest

集成了 typescript 的单元测试相关包。

Installation

npm install @nosaid/jest --save-dev

Usage

& vim jest.config.js
// eslint-disable-next-line
module.exports = {
    moduleNameMapper: {
        '^@/(.*)$': '<rootDir>/$1',
        '^vue$': 'vue/dist/vue.common.js',
        '^~/(.*)$': '<rootDir>/client/$1'
    },
    moduleFileExtensions: ['ts', 'js', 'vue', 'json'],
    transform: {
        '^.+\\.js$': 'babel-jest',
        '.*\\.(vue)$': 'vue-jest',
        '^.+\\.tsx?$': 'ts-jest'
    },
    collectCoverage: true,
    collectCoverageFrom: ['<rootDir>/client/components/**/*.vue', '<rootDir>/client/pages/**/*.vue']
};
& vim package.json
{
    "scripts": {
        ...,
        "test": "jest"
    }
}

Readme

Keywords

Package Sidebar

Install

npm i @nosaid/jest

Weekly Downloads

3

Version

0.0.4

License

MIT

Unpacked Size

2.44 kB

Total Files

3

Last publish

Collaborators

  • shalldie