Skip to content

Commit

Permalink
Fix Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Nov 8, 2020
1 parent bf9178b commit 6fb712a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,11 @@ it('uses absolute path on request', () => {
to: '/dir/b.css',
map: { inline: false, absolute: true }
})
expect(result.map.toJSON().sources).toEqual([
`file://${parse(process.cwd()).root}dir/a.css`
])
let root = '/'
if (process.platform === 'win32') {
root = '/' + parse(process.cwd()).root.replace(/\\/g, '/')
}
expect(result.map.toJSON().sources).toEqual([`file://${root}dir/a.css`])
})

it('preserves absolute urls in sources from previous map', () => {
Expand Down

0 comments on commit 6fb712a

Please sign in to comment.