Skip to content

Commit

Permalink
chore: remove windows skip
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Jul 28, 2021
1 parent 08107f7 commit 6e6d148
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [windows-latest]
node: [14, 16]
fail-fast: true
steps:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"@types/semver": "^7.3.4",
"@types/update-notifier": "^5.0.0",
"@types/yargs": "^17.0.0",
"cross-paths": "^1.0.4",
"electron": "^13.1.6",
"iso-url": "^1.1.5",
"sinon": "^11.1.1",
Expand Down
41 changes: 21 additions & 20 deletions test/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,39 @@

const { expect } = require('../utils/chai')
const execa = require('execa')
const process = require('process')
const { copy, existsSync } = require('fs-extra')
const { join } = require('path')
const bin = require.resolve('../')
const tempy = require('tempy')

describe('build', () => {
if (process.platform !== 'win32') {
describe('esm', () => {
let projectDir = ''
describe('esm', () => {
let projectDir = ''

before(async () => {
projectDir = tempy.directory()
before(async () => {
projectDir = tempy.directory()

await copy(join(__dirname, 'fixtures', 'esm', 'an-esm-project'), projectDir)
})
await copy(join(__dirname, 'fixtures', 'esm', 'an-esm-project'), projectDir)
})

it('should build an esm project', async function () {
this.timeout(20 * 1000) // slow ci is slow
it('should build an esm project', async function () {
this.timeout(20 * 1000) // slow ci is slow

await execa(bin, ['build'], {
cwd: projectDir
})
// projectDir = `${projectDir.charAt(0)}:\\${projectDir.substring(2)}`
// eslint-disable-next-line
console.log('dir', projectDir)

expect(existsSync(join(projectDir, 'dist', 'esm'))).to.be.true()
expect(existsSync(join(projectDir, 'dist', 'cjs'))).to.be.true()
await execa(bin, ['build'], {
cwd: encodeURI(projectDir)
})

const module = require(join(projectDir, 'dist'))
expect(existsSync(join(projectDir, 'dist', 'esm'))).to.be.true()
expect(existsSync(join(projectDir, 'dist', 'cjs'))).to.be.true()

expect(module).to.have.property('useHerp').that.is.a('function')
expect(module).to.have.property('useDerp').that.is.a('function')
})
const module = require(join(projectDir, 'dist'))

expect(module).to.have.property('useHerp').that.is.a('function')
expect(module).to.have.property('useDerp').that.is.a('function')
})
}
})
})

0 comments on commit 6e6d148

Please sign in to comment.