@@ -7,6 +7,10 @@ const VersionChecker = require('..');
77const execSync = require ( 'child_process' ) . execSync ;
88const 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+
1014function 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