Repository: ember-cli/ember-cli
Pull request #8002 (2018-08-29 01:34:01)

fixed package-info-cache-test to use ${path.sep} instead of / to work on Windows


Patch:
diff --git a/lib/broccoli/ember-app.js b/lib/broccoli/ember-app.js
index 8382f8a9d..072627d5c 100644
--- a/lib/broccoli/ember-app.js
+++ b/lib/broccoli/ember-app.js
@@ -1078,8 +1078,7 @@ class EmberApp {
     });
 
     return new Funnel(mergedAddonStyles, {
-      allowEmpty: true,
-      destDir: `${this.name}/styles`,
+      destDir: this.name,
     });
   }
 


Test patch:
diff --git a/tests/unit/broccoli/ember-app-test.js b/tests/unit/broccoli/ember-app-test.js
index 1d775af80..3731f73f6 100644
--- a/tests/unit/broccoli/ember-app-test.js
+++ b/tests/unit/broccoli/ember-app-test.js
@@ -146,7 +146,6 @@ describe('EmberApp', function() {
             javascript: '// javascript.js',
           },
           'test-project': {
-            styles: {},
             templates: {},
           },
           tests: {
@@ -232,28 +231,10 @@ describe('EmberApp', function() {
   }
 
   describe('getAddonStyles()', function() {
-    it('can handle empty styles folders', co.wrap(function *() {
-      let app = new EmberApp({
-        project,
-      });
-
-      app.addonTreesFor = () => [];
-
-      let output = yield buildOutput(app.getAddonStyles());
-      let outputFiles = output.read();
-
-      expect(outputFiles['test-project']).to.deep.equal({
-        styles: { },
-      });
-
-      yield output.dispose();
-    }));
-
     it('returns add-ons styles files', co.wrap(function *() {
       let addonFooStyles = yield createTempDir();
       let addonBarStyles = yield createTempDir();
 
-      // `ember-basic-dropdown`
       addonFooStyles.write({
         app: {
           styles: {
@@ -261,10 +242,11 @@ describe('EmberApp', function() {
           },
         },
       });
-      // `ember-bootstrap`
       addonBarStyles.write({
-        baztrap: {
-          'baztrap.css': '// baztrap.css',
+        app: {
+          styles: {
+            'bar.css': 'bar',
+          },
         },
       });
 
@@ -282,14 +264,10 @@ describe('EmberApp', function() {
       let outputFiles = output.read();
 
       expect(outputFiles['test-project']).to.deep.equal({
-        styles: {
-          app: {
-            styles: {
-              'foo.css': 'foo',
-            },
-          },
-          baztrap: {
-            'baztrap.css': '// baztrap.css',
+        app: {
+          styles: {
+            'foo.css': 'foo',
+            'bar.css': 'bar',
           },
         },
       });
diff --git a/tests/unit/models/package-info-cache-test.js b/tests/unit/models/package-info-cache-test.js
index 2e5623c57..9e9bf5993 100644
--- a/tests/unit/models/package-info-cache-test.js
+++ b/tests/unit/models/package-info-cache-test.js
@@ -186,6 +186,7 @@ describe('models/package-info-cache.js', function() {
     });
 
   });
+
   describe('packageInfo', function() {
     describe('valid project', function() {
       let project, fixturifyProject;
@@ -207,7 +208,7 @@ describe('models/package-info-cache.js', function() {
         project = fixturifyProject.buildProjectModel(Project);
         project.discoverAddons();
         pic = project.packageInfoCache;
-        projectPackageInfo = pic.getEntry(`${fixturifyProject.root}/simple-ember-app`);
+        projectPackageInfo = pic.getEntry(`${fixturifyProject.root}${path.sep}simple-ember-app`);
       });
 
       after(function() {
@@ -254,7 +255,7 @@ describe('models/package-info-cache.js', function() {
 
         expect(inRepoAddons).to.exist;
         expect(inRepoAddons.length).to.equal(1);
-        expect(inRepoAddons[0].realPath).to.contain('simple-ember-app/lib/ember-super-button');
+        expect(inRepoAddons[0].realPath).to.contain(`simple-ember-app${path.sep}lib${path.sep}ember-super-button`);
         expect(inRepoAddons[0].pkg.name).to.equal('ember-super-button');
       });