@amjs/vue-tools
![npm](https://img.shields.io/npm/v/@amjs/vue-tools?style=flat-square)
Last updated a month ago by amjs .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @amjs/vue-tools 
SYNC missed versions from official npm registry.

@amjs/vue-tools

npm

Provides development tools for VueJS based projects with Webpack4 and JEST.

Installation

$ npm i --save @amjs/vue-tools

Usage

Add following scripts to package.json file:

{
    "scripts": {
       "dev": "NODE_ENV=development node node_modules/@amjs/vue-tools/scripts/server.js",
       "build": "NODE_ENV=production node node_modules/@amjs/vue-tools/scripts/build.js",
       "test": "NODE_ENV=test node node_modules/@amjs/vue-tools/scripts/jest.js",
       "format": "prettier --config node_modules/@amjs/vue-tools/.prettierrc --write 'src/**/*.js'",
       "lint:css": "sass-lint --config node_modules/@amjs/vue-tools/.sass-lint.yml -v",
       "lint:js": "eslint --fix --config node_modules/@amjs/vue-tools/.eslintrc.yml --ext .js src __tests__"
    }
}

Tools

@amjs/vue-tools provides a set-up of tools to use in any VueJS project.

VueJS configuration

Just add following line to project's entry point:

import '@amjs/vue-tools/config/vue';

Fetch mock for tests

Just add following line to test file:

import '%/tests/utils/fetch';

VueJS instance renderer for tests

// test file
import renderer from '%/tests/utils/renderer';
import MyComponent from 'my-component-path';

// Create a snapshot:
it('Snapshot', async () =>
    expect(await renderer(MyComponent, null, true)).toMatchSnapshot());

// Create instance
it('Instance', async () =>
{
    const props = {
        key: 'value'
    };
    const inst = await renderer(MyComponent, props);
    expect(inst.key).toBe('value');
});

Current Tags

  • 1.0.4                                ...           latest (a month ago)

10 Versions

  • 1.0.4                                ...           a month ago
  • 1.0.3                                ...           a month ago
  • 1.0.2                                ...           a month ago
  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           8 months ago
  • 0.4.0                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.1.2                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 10
Last Month 30
Dependencies (65)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |