Skip to content

Commit b87e72a

Browse files
committed
chore: remove the NODE 4 tests.
1 parent cfdd49d commit b87e72a

File tree

4 files changed

+54
-70
lines changed

4 files changed

+54
-70
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
sudo: false
22
env:
3-
- NODE_VERSION=4 SCRIPT=lint
4-
- NODE_VERSION=4 SCRIPT=test
3+
- NODE_VERSION=5 SCRIPT=lint
54
- NODE_VERSION=5 SCRIPT=test
65
os:
76
- linux
87
- osx
98
matrix:
109
exclude:
1110
- os: osx
12-
env: NODE_VERSION=4 SCRIPT=lint
11+
env: NODE_VERSION=5 SCRIPT=lint
1312

1413
script:
1514
- npm run-script $SCRIPT

lib/broccoli/angular2-app.js

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class Angular2App extends BroccoliPlugin {
2424
super();
2525
options = options || {};
2626

27+
this._initProject();
28+
2729
this._options = options;
2830
this._sourceDir = options.sourceDir || 'src/client';
2931
this._inputNode = inputNode || this._buildInputTree();
@@ -34,7 +36,6 @@ class Angular2App extends BroccoliPlugin {
3436
additionalFiles: ['**/*.spec.ts']
3537
};
3638

37-
this._initProject();
3839
this._notifyAddonIncluded();
3940

4041
this._tree = this._buildTree();
@@ -72,13 +73,13 @@ class Angular2App extends BroccoliPlugin {
7273
*/
7374
_buildInputTree() {
7475
return new BroccoliMergeTrees([
75-
new BroccoliFunnel(this._sourceDir, { destDir: this._sourceDir, name: 'source' }),
76-
new BroccoliFunnel('typings', { include: ['browser.d.ts', 'browser/**/*' ], destDir: 'typings' }),
77-
new BroccoliFunnel('config', { destDir: 'config' }),
78-
new BroccoliFunnel('public', { destDir: 'public' })
79-
], {
80-
overwrite: true
81-
});
76+
new BroccoliFunnel(this._sourceDir, { destDir: this._sourceDir, name: 'source' }),
77+
new BroccoliFunnel('typings', { include: ['browser.d.ts', 'browser/**/*' ], destDir: 'typings' }),
78+
new BroccoliFunnel('config', { destDir: 'config' }),
79+
new BroccoliFunnel('public', { destDir: 'public' })
80+
], {
81+
overwrite: true
82+
});
8283
}
8384

8485
/**
@@ -419,18 +420,12 @@ class Angular2App extends BroccoliPlugin {
419420
* @return {Funnel} The config files tree.
420421
*/
421422
_getConfigTree() {
422-
var environment = process.env.EMBER_ENV;
423-
if (environment == 'production') {
424-
environment = 'prod';
425-
} else if (environment == 'development') {
426-
environment = 'dev';
427-
}
428-
var envConfigFile = `config/environment.${environment}.ts`;
423+
var envConfigFile = isProduction ? 'environment.prod.ts' : 'environment.dev.ts';
429424

430-
return new BroccoliFunnel(this._inputNode, {
431-
files: [envConfigFile],
432-
getDestinationPath: () => path.join(this._sourceDir, 'app/environment.ts'),
433-
name: 'environment'
425+
return new BroccoliFunnel('config', {
426+
include: [envConfigFile],
427+
destDir: path.join(this._sourceDir, 'app'),
428+
getDestinationPath: () => 'environment.ts'
434429
});
435430
}
436431
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"shelljs": "^0.6.0",
5151
"silent-error": "^1.0.0",
5252
"symlink-or-copy": "^1.0.1",
53-
"tslint": "^3.8.0",
5453
"typescript": "^1.9.0-dev.20160421",
5554
"typings": "^0.7.9"
5655
},

tests/e2e/e2e_workflow.spec.js

Lines changed: 38 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ function existsSync(path) {
1919
}
2020
}
2121

22+
const bin = path.normalize('./node_modules/angular-cli/bin/ng');
23+
24+
2225
describe('Basic end-to-end Workflow', function () {
2326
before(conf.setup);
2427

@@ -62,7 +65,7 @@ describe('Basic end-to-end Workflow', function () {
6265

6366
// Can't user the `ng` helper because somewhere the environment gets
6467
// stuck to the first build done
65-
sh.exec('ng build --environment=production --silent');
68+
sh.exec(`${bin} build --environment=production --silent`);
6669
expect(existsSync(path.join(process.cwd(), 'dist'))).to.be.equal(true);
6770
var envPath = path.join(process.cwd(), 'dist', 'app', 'environment.js');
6871
var envContent = fs.readFileSync(envPath, { encoding: 'utf8' });
@@ -77,13 +80,9 @@ describe('Basic end-to-end Workflow', function () {
7780
return ng(['build', '--silent'])
7881
.then(function () {
7982
expect(existsSync(path.join(process.cwd(), 'dist'))).to.be.equal(true);
80-
})
81-
.then(function () {
83+
8284
// Also does not create new things in GIT.
8385
expect(sh.exec('git status --porcelain').output).to.be.equal('');
84-
})
85-
.catch(() => {
86-
throw new Error('Build failed.');
8786
});
8887
});
8988

@@ -190,45 +189,41 @@ describe('Basic end-to-end Workflow', function () {
190189
return ng(['build', '--silent'])
191190
.then(function () {
192191
expect(existsSync(tmpFileLocation));
193-
})
194-
.catch(err => {
195-
throw new Error(err)
196192
});
197193
});
198194

199195
it('Installs sass support successfully', function() {
200196
this.timeout(420000);
201197

202198
sh.exec('npm install node-sass', { silent: true });
203-
return ng(['generate', 'component', 'test-component'])
204-
.then(() => {
205-
let componentPath = path.join(process.cwd(), 'src', 'client', 'app', 'test-component');
206-
let cssFile = path.join(componentPath, 'test-component.component.css');
207-
let scssFile = path.join(componentPath, 'test-component.component.scss');
208-
209-
expect(existsSync(componentPath)).to.be.equal(true);
210-
sh.mv(cssFile, scssFile);
211-
expect(existsSync(scssFile)).to.be.equal(true);
212-
expect(existsSync(cssFile)).to.be.equal(false);
213-
let scssExample = '.outer {\n .inner { background: #fff; }\n }';
214-
fs.writeFileSync(scssFile, scssExample, 'utf8');
215-
216-
sh.exec('ng build --silent');
217-
let destCss = path.join(process.cwd(), 'dist', 'app', 'test-component', 'test-component.component.css');
218-
expect(existsSync(destCss)).to.be.equal(true);
219-
let contents = fs.readFileSync(destCss, 'utf8');
220-
expect(contents).to.include('.outer .inner');
221-
222-
sh.rm('-f', destCss);
223-
process.chdir('src');
224-
sh.exec('ng build --silent');
225-
expect(existsSync(destCss)).to.be.equal(true);
226-
contents = fs.readFileSync(destCss, 'utf8');
227-
expect(contents).to.include('.outer .inner');
228-
229-
process.chdir('..');
230-
sh.exec('npm uninstall node-sass', { silent: true });
231-
});
199+
sh.exec(`${bin} generate component test-component`);
200+
201+
let componentPath = path.join(process.cwd(), 'src', 'client', 'app', 'test-component');
202+
let cssFile = path.join(componentPath, 'test-component.component.css');
203+
let scssFile = path.join(componentPath, 'test-component.component.scss');
204+
205+
expect(existsSync(componentPath)).to.be.equal(true);
206+
sh.mv(cssFile, scssFile);
207+
expect(existsSync(scssFile)).to.be.equal(true);
208+
expect(existsSync(cssFile)).to.be.equal(false);
209+
let scssExample = '.outer {\n .inner { background: #fff; }\n }';
210+
fs.writeFileSync(scssFile, scssExample, 'utf8');
211+
212+
sh.exec(`${bin} build --silent`);
213+
let destCss = path.join(process.cwd(), 'dist', 'app', 'test-component', 'test-component.component.css');
214+
expect(existsSync(destCss)).to.be.equal(true);
215+
let contents = fs.readFileSync(destCss, 'utf8');
216+
expect(contents).to.include('.outer .inner');
217+
218+
sh.rm('-f', destCss);
219+
process.chdir('src');
220+
sh.exec(`../${bin} build --silent`);
221+
expect(existsSync(destCss)).to.be.equal(true);
222+
contents = fs.readFileSync(destCss, 'utf8');
223+
expect(contents).to.include('.outer .inner');
224+
225+
process.chdir('..');
226+
sh.exec('npm uninstall node-sass', { silent: true });
232227
});
233228

234229
it('Installs less support successfully', function() {
@@ -248,15 +243,15 @@ describe('Basic end-to-end Workflow', function () {
248243
let lessExample = '.outer {\n .inner { background: #fff; }\n }';
249244
fs.writeFileSync(lessFile, lessExample, 'utf8');
250245

251-
sh.exec('ng build --silent');
246+
sh.exec(`${bin} build --silent`);
252247
let destCss = path.join(process.cwd(), 'dist', 'app', 'test-component', 'test-component.component.css');
253248
expect(existsSync(destCss)).to.be.equal(true);
254249
let contents = fs.readFileSync(destCss, 'utf8');
255250
expect(contents).to.include('.outer .inner');
256251

257252
sh.rm('-f', destCss);
258253
process.chdir('src');
259-
sh.exec('ng build --silent');
254+
sh.exec(`../${bin} build --silent`);
260255
expect(existsSync(destCss)).to.be.equal(true);
261256
contents = fs.readFileSync(destCss, 'utf8');
262257
expect(contents).to.include('.outer .inner');
@@ -282,15 +277,15 @@ describe('Basic end-to-end Workflow', function () {
282277
let stylusExample = '.outer {\n .inner { background: #fff; }\n }';
283278
fs.writeFileSync(stylusFile, stylusExample, 'utf8');
284279

285-
sh.exec('ng build --silent');
280+
sh.exec(`${bin} build --silent`);
286281
let destCss = path.join(process.cwd(), 'dist', 'app', 'test-component', 'test-component.component.css');
287282
expect(existsSync(destCss)).to.be.equal(true);
288283
let contents = fs.readFileSync(destCss, 'utf8');
289284
expect(contents).to.include('.outer .inner');
290285

291286
sh.rm('-f', destCss);
292287
process.chdir('src');
293-
sh.exec('ng build --silent');
288+
sh.exec(`../${bin} build --silent`);
294289
expect(existsSync(destCss)).to.be.equal(true);
295290
contents = fs.readFileSync(destCss, 'utf8');
296291
expect(contents).to.include('.outer .inner');
@@ -314,11 +309,7 @@ describe('Basic end-to-end Workflow', function () {
314309
return ng(['build', '--silent'])
315310
.then(function () {
316311
expect(existsSync(path.join(process.cwd(), 'dist'))).to.be.equal(true);
317-
})
318-
.catch(() => {
319-
throw new Error('Build failed.');
320-
})
321-
.finally(function () {
312+
322313
// Clean `tmp` folder
323314
process.chdir(path.resolve(root, '..'));
324315
sh.rm('-rf', './tmp'); // tmp.teardown takes too long

0 commit comments

Comments
 (0)