|
5 | 5 | const assert = require('assert'); |
6 | 6 | const VersionChecker = require('..'); |
7 | 7 | 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; |
9 | 14 |
|
10 | 15 | function isObject(x) { |
11 | 16 | return typeof x === 'object' && x !== null; |
@@ -501,59 +506,57 @@ describe('ember-cli-version-checker', function() { |
501 | 506 | }); |
502 | 507 | } |
503 | 508 |
|
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); |
529 | 511 |
|
530 | | - execSync('yarn'); |
531 | | - }); |
| 512 | + beforeEach(function() { |
| 513 | + process.chdir(projectRoot.path()); |
532 | 514 |
|
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 | + }`), |
535 | 532 | }); |
536 | 533 |
|
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 | + }); |
541 | 536 |
|
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 | + }); |
547 | 540 |
|
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 | + ); |
550 | 545 |
|
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 | + ); |
553 | 550 | }); |
554 | | - } |
555 | 551 |
|
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() { |
557 | 560 | this.timeout(600000); |
558 | 561 |
|
559 | 562 | beforeEach(function() { |
|
0 commit comments