Skip to content

Commit 62a76c9

Browse files
authored
Merge pull request #173 from ember-cli/windows-ci
Add partial windows coverage
2 parents 314b10c + d61cad3 commit 62a76c9

File tree

2 files changed

+49
-46
lines changed

2 files changed

+49
-46
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
matrix:
2121
node: ['10', '12']
22-
os: [ubuntu-latest, macOS-latest]
22+
os: [ubuntu-latest, macOS-latest, windows-latest]
2323

2424
steps:
2525
- uses: actions/checkout@v1

tests/index-tests.js

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
const assert = require('assert');
66
const VersionChecker = require('..');
77
const execSync = require('child_process').execSync;
8-
const semver = require('semver');
8+
9+
// There are some issues with PNP + worksapces on windows that will require debugging
10+
// https://github.com/ember-cli/ember-cli-version-checker/issues/100
11+
const skipWindows = process.platform.includes('win32')
12+
? describe.skip
13+
: describe;
914

1015
function isObject(x) {
1116
return typeof x === 'object' && x !== null;
@@ -501,59 +506,57 @@ describe('ember-cli-version-checker', function() {
501506
});
502507
}
503508

504-
if (semver.gte(process.versions.node, '8.0.0')) {
505-
describe('with yarn pnp', function() {
506-
this.timeout(600000);
507-
508-
beforeEach(function() {
509-
process.chdir(projectRoot.path());
510-
511-
projectRoot.write({
512-
'package.json': JSON.stringify({
513-
private: true,
514-
name: 'test-project',
515-
version: '0.0.0',
516-
dependencies: {
517-
'ember-source-channel-url': '1.1.0',
518-
'ember-cli-version-checker': `link:${ROOT}`,
519-
},
520-
installConfig: {
521-
pnp: true,
522-
},
523-
}),
524-
'index.js': buildVersionCheckerBin(`{
525-
root: process.cwd(),
526-
isEmberCLIProject() {},
527-
}`),
528-
});
509+
skipWindows('with yarn pnp', function() {
510+
this.timeout(600000);
529511

530-
execSync('yarn');
531-
});
512+
beforeEach(function() {
513+
process.chdir(projectRoot.path());
532514

533-
afterEach(function() {
534-
process.chdir(ROOT);
515+
projectRoot.write({
516+
'package.json': JSON.stringify({
517+
private: true,
518+
name: 'test-project',
519+
version: '0.0.0',
520+
dependencies: {
521+
'ember-source-channel-url': '1.1.0',
522+
'ember-cli-version-checker': `link:${ROOT}`,
523+
},
524+
installConfig: {
525+
pnp: true,
526+
},
527+
}),
528+
'index.js': buildVersionCheckerBin(`{
529+
root: process.cwd(),
530+
isEmberCLIProject() {},
531+
}`),
535532
});
536533

537-
it('finds packages that are present', function() {
538-
let result = execSync(
539-
'node -r ./.pnp.js ./index.js ember-source-channel-url'
540-
);
534+
execSync('yarn');
535+
});
541536

542-
assert.strictEqual(
543-
result.toString(),
544-
'ember-source-channel-url: 1.1.0\n'
545-
);
546-
});
537+
afterEach(function() {
538+
process.chdir(ROOT);
539+
});
547540

548-
it('does not find packages that are missing', function() {
549-
let result = execSync('node -r ./.pnp.js ./index.js blah-blah-blah');
541+
it('finds packages that are present', function() {
542+
let result = execSync(
543+
'node -r ./.pnp.js ./index.js ember-source-channel-url'
544+
);
550545

551-
assert.strictEqual(result.toString(), 'blah-blah-blah: undefined\n');
552-
});
546+
assert.strictEqual(
547+
result.toString(),
548+
'ember-source-channel-url: 1.1.0\n'
549+
);
553550
});
554-
}
555551

556-
describe('with yarn workspace', function() {
552+
it('does not find packages that are missing', function() {
553+
let result = execSync('node -r ./.pnp.js ./index.js blah-blah-blah');
554+
555+
assert.strictEqual(result.toString(), 'blah-blah-blah: undefined\n');
556+
});
557+
});
558+
559+
skipWindows('with yarn workspace', function() {
557560
this.timeout(600000);
558561

559562
beforeEach(function() {

0 commit comments

Comments
 (0)