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 cf254fe
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 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
48 changes: 27 additions & 21 deletions test/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,44 @@

const { expect } = require('../utils/chai')
const execa = require('execa')
const process = require('process')
const { copy, existsSync } = require('fs-extra')
const fs = require('fs')
const os = require('os')
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 = `${os.tmpdir()}/${Date.now()}`

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
await copy(join(__dirname, 'fixtures', 'esm', 'an-esm-project'), projectDir)
})

await execa(bin, ['build'], {
cwd: projectDir
})
after(async () => {
await fs.promises.rm(projectDir, { recursive: true })
})

expect(existsSync(join(projectDir, 'dist', 'esm'))).to.be.true()
expect(existsSync(join(projectDir, 'dist', 'cjs'))).to.be.true()
it('should build an esm project', async function () {
this.timeout(20 * 1000) // slow ci is slow

const module = require(join(projectDir, 'dist'))
// projectDir = `${projectDir.charAt(0)}:\\${projectDir.substring(2)}`
// eslint-disable-next-line
console.log('dir', projectDir)

expect(module).to.have.property('useHerp').that.is.a('function')
expect(module).to.have.property('useDerp').that.is.a('function')
await execa(bin, ['build'], {
cwd: projectDir
})

expect(existsSync(join(projectDir, 'dist', 'esm'))).to.be.true()
expect(existsSync(join(projectDir, 'dist', 'cjs'))).to.be.true()

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 cf254fe

Please sign in to comment.