Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Fix tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Oct 18, 2021
1 parent 7d86505 commit 03d9dc6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/check.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

'use strict'

const path = require('path')

const chai = require('chai')
const chaiAsPromised = require('chai-as-promised')

Expand Down Expand Up @@ -115,13 +117,13 @@ describe('check()', () => {
noDefaultEntries: true,
entries: ['readme.md']
})
.should.be.rejectedWith(Error, `Detective function missing for "${process.cwd()}/readme.md"`)
.should.be.rejectedWith(Error, `Detective function missing for "${process.cwd() + path.sep}readme.md"`)
})

it('should throw when encountering local file that does not exist', async () => {
await check({
path: 'test/mock-missing-local-file/'
})
.should.be.rejectedWith(Error, `Cannot find module '${process.cwd()}/test/mock-missing-local-file/not-found.js' from '${process.cwd()}/test/mock-missing-local-file'`)
.should.be.rejectedWith(Error, `Cannot find module '${process.cwd() + path.sep}test/mock-missing-local-file/not-found.js' from '${process.cwd() + path.sep}test/mock-missing-local-file'`)
})
})

0 comments on commit 03d9dc6

Please sign in to comment.