Skip to content

Commit 7db225c

Browse files
committed
chore: remove windows skip
1 parent 08107f7 commit 7db225c

2 files changed

Lines changed: 35 additions & 22 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
19-
os: [windows-latest, ubuntu-latest, macos-latest]
19+
os: [windows-latest]
2020
node: [14, 16]
2121
fail-fast: true
2222
steps:

test/build.js

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,51 @@
33

44
const { expect } = require('../utils/chai')
55
const execa = require('execa')
6-
const process = require('process')
76
const { copy, existsSync } = require('fs-extra')
8-
const { join } = require('path')
7+
const fs = require('fs')
8+
const os = require('os')
9+
const { join, normalize } = require('path')
910
const bin = require.resolve('../')
10-
const tempy = require('tempy')
1111

1212
describe('build', () => {
13-
if (process.platform !== 'win32') {
14-
describe('esm', () => {
15-
let projectDir = ''
13+
describe('esm', () => {
14+
let projectDir = ''
1615

17-
before(async () => {
18-
projectDir = tempy.directory()
16+
before(async () => {
17+
projectDir = `${os.tmpdir()}/${Date.now()}`
1918

20-
await copy(join(__dirname, 'fixtures', 'esm', 'an-esm-project'), projectDir)
21-
})
19+
await copy(join(__dirname, 'fixtures', 'esm', 'an-esm-project'), projectDir)
20+
})
21+
22+
after(async () => {
23+
await fs.promises.rm(projectDir, { recursive: true })
24+
})
25+
26+
it('should build an esm project', async function () {
27+
this.timeout(20 * 1000) // slow ci is slow
2228

23-
it('should build an esm project', async function () {
24-
this.timeout(20 * 1000) // slow ci is slow
29+
// eslint-disable-next-line
30+
console.log('dir', projectDir)
31+
// eslint-disable-next-line
32+
console.log('bin', bin, )
2533

26-
await execa(bin, ['build'], {
27-
cwd: projectDir
34+
try {
35+
await execa(normalize(`${bin}`), ['build'], {
36+
cwd: normalize(projectDir),
37+
windowsVerbatimArguments: true
2838
})
39+
} catch (err) {
40+
// eslint-disable-next-line
41+
console.log('err', err)
42+
}
2943

30-
expect(existsSync(join(projectDir, 'dist', 'esm'))).to.be.true()
31-
expect(existsSync(join(projectDir, 'dist', 'cjs'))).to.be.true()
44+
expect(existsSync(join(projectDir, 'dist', 'esm'))).to.be.true()
45+
expect(existsSync(join(projectDir, 'dist', 'cjs'))).to.be.true()
3246

33-
const module = require(join(projectDir, 'dist'))
47+
const module = require(join(projectDir, 'dist'))
3448

35-
expect(module).to.have.property('useHerp').that.is.a('function')
36-
expect(module).to.have.property('useDerp').that.is.a('function')
37-
})
49+
expect(module).to.have.property('useHerp').that.is.a('function')
50+
expect(module).to.have.property('useDerp').that.is.a('function')
3851
})
39-
}
52+
})
4053
})

0 commit comments

Comments
 (0)