
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@paliari/vue-test-utils
Advanced tools
#Install
Use npm
$ npm install -D @paliari/vue-test-utils --save
Use yarn
$ yarn add -D @paliari/vue-test-utils
With this it is possible to mock the paliari vue store helper methods (base, paginator, crud)
Usage sample:
import '@paliari/vue-test-utils/__mocks__/StoreHelpers'
import paliariVue from 'paliari-vue'
import 'store/modules/anyStore'
import api from './__mocks__/api'
const { StoreHelpers } = paliariVue
it('should to call the auxiliary store with the correct parameters', () => {
expect(StoreHelper.base).toBeCalledTimes(1)
expect(StoreHelper.base).toBeCalledWith({ namespaced: true }, api)
})
Mocks of the main filters used in the projects
Usage sample:
import { shallowMount } from '@vue/test-utils'
import { filters } from '@paliari/vue-test-utils'
import Component from '@/views/Zubumafu.vue'
describe('renderer', () => {
it('should matched snapshot', () => {
const wrapper = shallowMount(Component, { filters })
expect(wrapper.element).toMatchSnapshot()
})
it('should to call filter cpfCnpj', () => {
expect(filters.cpfCnpj).toBeCalledTimes(1)
expect(filters.cpfCnpj).toBeCalledWith('00000000000')
})
})
Single imports sample:
import { cpfCnpj, truncate, date } from '@paliari/vue-test-utils/__mocks__/filters'
Available filters
name | params | returns |
---|---|---|
cpfCnpj | (value) | v |
currency | (number, prefix = '', sufix = '') | ${prefix}${number}${sufix} |
date | (value, format) | value |
truncate | (text, length = 30) | text.substr(0, length - 3) + '...' |
FAQs
JS test utils
The npm package @paliari/vue-test-utils receives a total of 0 weekly downloads. As such, @paliari/vue-test-utils popularity was classified as not popular.
We found that @paliari/vue-test-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.