Skip to content

Commit

Permalink
dont run for EMBER_CLI_ENABLE_ALL_EXPERIMENTS
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Feb 19, 2019
1 parent 6f6f2a7 commit 3191320
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions tests/acceptance/addon-smoke-test-slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,47 +190,51 @@ describe('Acceptance: addon-smoke-test', function() {

if (isExperimentEnabled('MODULE_UNIFICATION')) {

it('works with classic addon and MU dummy app', co.wrap(function *() {
let fixtureFile = 'kitchen-sink-classic-mu-dummy-app';
yield copyFixtureFiles(`addon/${fixtureFile}`);
if (!process.env.EMBER_CLI_ENABLE_ALL_EXPERIMENTS) {
// does not work, since ember-resolver addon checks for env.EMBER_CLI_MODULE_UNIFICATION
// and project.isModuleUnification returns false, since the project is an classic addon
it('works with classic addon and MU dummy app', co.wrap(function *() {
let fixtureFile = 'kitchen-sink-classic-mu-dummy-app';
yield copyFixtureFiles(`addon/${fixtureFile}`);

// prevent MU detection
if (yield fs.exists('src')) {
rimraf.sync('src');
}
// prevent MU detection
if (yield fs.exists('src')) {
rimraf.sync('src');
}

let packageJsonPath = path.join(addonRoot, 'package.json');
let packageJson = fs.readJsonSync(packageJsonPath);
let packageJsonPath = path.join(addonRoot, 'package.json');
let packageJson = fs.readJsonSync(packageJsonPath);

expect(packageJson.devDependencies['ember-source']).to.not.be.empty;
expect(packageJson.devDependencies['ember-source']).to.not.be.empty;

packageJson.dependencies = packageJson.dependencies || {};
// add HTMLBars for templates (generators do this automatically when components/templates are added)
packageJson.dependencies['ember-cli-htmlbars'] = 'latest';
packageJson.dependencies = packageJson.dependencies || {};
// add HTMLBars for templates (generators do this automatically when components/templates are added)
packageJson.dependencies['ember-cli-htmlbars'] = 'latest';

fs.writeJsonSync(packageJsonPath, packageJson);
fs.writeJsonSync(packageJsonPath, packageJson);

let result = yield runCommand('node_modules/ember-cli/bin/ember', 'build');
let result = yield runCommand('node_modules/ember-cli/bin/ember', 'build');

expect(result.code).to.eql(0);
let contents;
expect(result.code).to.eql(0);
let contents;

let indexPath = path.join(addonRoot, 'dist', 'index.html');
contents = fs.readFileSync(indexPath, { encoding: 'utf8' });
expect(contents).to.contain('"SOME AWESOME STUFF"');
let indexPath = path.join(addonRoot, 'dist', 'index.html');
contents = fs.readFileSync(indexPath, { encoding: 'utf8' });
expect(contents).to.contain('"SOME AWESOME STUFF"');

let cssPath = path.join(addonRoot, 'dist', 'assets', 'vendor.css');
contents = fs.readFileSync(cssPath, { encoding: 'utf8' });
expect(contents).to.contain('addon/styles/app.css is present');
//
let robotsPath = path.join(addonRoot, 'dist', 'robots.txt');
contents = fs.readFileSync(robotsPath, { encoding: 'utf8' });
expect(contents).to.contain('tests/dummy/public/robots.txt is present');
let cssPath = path.join(addonRoot, 'dist', 'assets', 'vendor.css');
contents = fs.readFileSync(cssPath, { encoding: 'utf8' });
expect(contents).to.contain('addon/styles/app.css is present');
//
let robotsPath = path.join(addonRoot, 'dist', 'robots.txt');
contents = fs.readFileSync(robotsPath, { encoding: 'utf8' });
expect(contents).to.contain('tests/dummy/public/robots.txt is present');

result = yield runCommand('node_modules/ember-cli/bin/ember', 'test');
result = yield runCommand('node_modules/ember-cli/bin/ember', 'test');

expect(result.code).to.eql(0);
}));
expect(result.code).to.eql(0);
}));
}

it('can run a MU unit test with a relative import', co.wrap(function *() {
yield copyFixtureFiles('brocfile-tests/mu-unit-test-with-relative-import');
Expand Down

0 comments on commit 3191320

Please sign in to comment.