Skip to content

Commit c02bd81

Browse files
committed
Add partial windows coverage
Skip PNP & Workspace tests -> Tracking issue: #100
1 parent fedbfa6 commit c02bd81

File tree

2 files changed

+48
-45
lines changed

2 files changed

+48
-45
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: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ const VersionChecker = require('..');
77
const execSync = require('child_process').execSync;
88
const semver = require('semver');
99

10+
// There are some issues with PNP + worksapces on windows that will require debugging
11+
// https://github.com/ember-cli/ember-cli-version-checker/issues/100
12+
const skipWindows = process.platform.includes('win32') ? describe.skip : describe;
13+
1014
function isObject(x) {
1115
return typeof x === 'object' && x !== null;
1216
}
@@ -501,59 +505,58 @@ describe('ember-cli-version-checker', function() {
501505
});
502506
}
503507

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-
});
508+
skipWindows('with yarn pnp', function() {
509+
this.timeout(600000);
529510

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

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

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

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

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

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

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

559562
beforeEach(function() {

0 commit comments

Comments
 (0)