chore(build): run render tests in Node

Closes #1358
This commit is contained in:
Marc Laval 2015-04-14 11:31:35 +02:00 committed by Misko Hevery
parent 0658d5602e
commit d3e391d176
2 changed files with 14 additions and 15 deletions

View File

@ -208,22 +208,15 @@ var CONFIG = {
test: {
js: {
cjs: [
'/angular2/test/change_detection/**/*_spec.js',
'/angular2/test/core/annotations/**/*_spec.js',
'/angular2/test/core/compiler/**/*_spec.js',
'/angular2/test/di/**/*_spec.js',
'/angular2/test/directives/**/*_spec.js',
'/angular2/test/facade/**/*_spec.js',
'/angular2/test/forms/**/*_spec.js',
'/angular2/test/mock/**/*_spec.js',
'/angular2/test/reflection/**/*_spec.js',
'/angular2/test/services/**/*_spec.js',
'/angular2/test/test_lib/**/*_spec.js'
'/angular2/test/**/*_spec.js'
]
}
}
};
CONFIG.test.js.cjs = CONFIG.test.js.cjs.map(function(s) {return CONFIG.dest.js.cjs + s});
CONFIG.test.js.cjs.push('!**/core/application_spec.js'); //Disabled in nodejs because it relies on Zone.js
CONFIG.test.js.cjs.push('!**/core/zone/vm_turn_zone_spec.js'); //Disabled in nodejs because it relies on Zone.js
CONFIG.test.js.cjs.push('!**/render/dom/events/event_manager_spec.js'); //Disabled in nodejs because it relies on DOM events
// ------------
// clean

View File

@ -148,13 +148,15 @@ export function main() {
expect(eventBinding.source.source).toEqual('doItGlobal()');
});
//TODO: assertions should be enabled when running tests: https://github.com/angular/angular/issues/1340
describe('viewport directives', () => {
it('should not allow multiple viewport directives on the same element', () => {
expect( () => {
process(
el('<template some-vp some-vp2></template>')
);
}).toThrowError('Only one viewport directive is allowed per element - check <template some-vp some-vp2>');
}).toThrowError('Only one viewport directive is allowed per element - check '
+ (assertionsEnabled() ? '<template some-vp some-vp2>' : 'null'));
});
it('should not allow viewport directives on non <template> elements', () => {
@ -162,10 +164,12 @@ export function main() {
process(
el('<div some-vp></div>')
);
}).toThrowError('Viewport directives need to be placed on <template> elements or elements with template attribute - check <div some-vp>');
}).toThrowError('Viewport directives need to be placed on <template> elements or elements with template attribute - check '
+ (assertionsEnabled() ? '<div some-vp>' : 'null'));
});
});
//TODO: assertions should be enabled when running tests: https://github.com/angular/angular/issues/1340
describe('component directives', () => {
it('should save the component id', () => {
var results = process(
@ -179,7 +183,8 @@ export function main() {
process(
el('<div some-comp some-comp2></div>')
);
}).toThrowError('Only one component directive is allowed per element - check <div some-comp some-comp2>');
}).toThrowError('Only one component directive is allowed per element - check '
+ (assertionsEnabled() ? '<div some-comp some-comp2>' : 'null'));
});
it('should not allow component directives on <template> elements', () => {
@ -187,7 +192,8 @@ export function main() {
process(
el('<template some-comp></template>')
);
}).toThrowError('Only template directives are allowed on template elements - check <template some-comp>');
}).toThrowError('Only template directives are allowed on template elements - check '
+ (assertionsEnabled() ? '<template some-comp>' : 'null'));
});
});