0.0.4 • Published 2 years ago

vitest-extra v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vitest-extra

provider extra match for vitest

npm GitHub

usage

pnpm i vitest-extra -D

extend extra functions

import { toMatchFile, toMatchFileContent, toMatchDir } from 'vitest-extra'
import { expect } from 'vitest'

expect.extend({ toMatchFile, toMatchFileContent, toMatchDir })

features

provide follow extra functions:

toMatchFile

compare file with expected file, e.g. expect(filepath).toMatchFile(filepath).

If expected not exit, create snapshot under __file_snapshots__

toMatchFileContent

compare file's content with expected file, e.g. expect(content).toMatchFile(filepath).

If expected not exit, create snapshot under __file_snapshots__

toMatchDir

compare dir's content and names with expected dir, e.g. expect(dir).toMatchFile(dir).

If expected not exit, create snapshot under __dir_snapshots__

development

  • Setup - pnpm i
  • Build - pnpm build

built with ❤️ by 😼

0.0.4

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago