1.2.0 • Published 3 years ago

comparedir-test v1.2.0

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

comparedir-test

compare dir in jest

npm GitHub

usage

pnpm i comparedir-test

compare files count

const fixtures = (type) => [
  path.resolve(__dirname, './fixtures', type, 'a'),
  path.resolve(__dirname, './fixtures', type, 'b'),
]
it('file content not match should return false', async () => {
  await compare(...fixtures('files-content-not-match'), {})
})

files-count
▲ files-count

compare files content

const fixtures = (type) => [
  path.resolve(__dirname, './fixtures', type, 'a'),
  path.resolve(__dirname, './fixtures', type, 'b'),
]
it('file content&count match should return true', async () => {
  await compare(...fixtures('basic'), {})
})

files-content
▲ files-content