Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(build): Add Promises/A+ Test Suite to the build #3693

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-ddescribe-iit');
grunt.loadNpmTasks('grunt-merge-conflict');
grunt.loadNpmTasks('grunt-parallel');
grunt.loadNpmTasks('grunt-shell');
grunt.loadTasks('lib/grunt');

var NG_VERSION = util.getVersion();
Expand Down Expand Up @@ -171,6 +172,10 @@ module.exports = function(grunt) {
cookies: {
dest: 'build/angular-cookies.js',
src: util.wrap(['src/ngCookies/cookies.js'], 'module')
},
promiseAdapter: {
dest:'build/promise-adapter.js',
src:['src/ng/q.js','promise-test-adapter.js']
}
},

Expand Down Expand Up @@ -227,6 +232,17 @@ module.exports = function(grunt) {
}
},

shell:{
testPromises:{
options:{
stderr:true,
failOnError:true
},
command:'./node_modules/.bin/promises-aplus-tests build/promise-adapter.js'
}

},


write: {
versionTXT: {file: 'build/version.txt', val: NG_VERSION.full},
Expand All @@ -236,14 +252,15 @@ module.exports = function(grunt) {


//alias tasks
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['package','test:unit', 'tests:docs', 'test:e2e']);
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['package','test:unit','shell:testPromises', 'tests:docs', 'test:e2e']);
grunt.registerTask('test:jqlite', 'Run the unit tests with Karma' , ['tests:jqlite']);
grunt.registerTask('test:jquery', 'Run the jQuery unit tests with Karma', ['tests:jquery']);
grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', ['tests:modules']);
grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['tests:jqlite', 'tests:jquery', 'tests:modules']);
grunt.registerTask('test:e2e', 'Run the end to end tests with Karma and keep a test server running in the background', ['connect:testserver', 'tests:end2end']);
grunt.registerTask('test:docgen', ['jasmine-node']);
grunt.registerTask('test:promises',['build:promiseAdapter','shell:testPromises']);

grunt.registerTask('minify', ['bower','clean', 'build', 'minall']);
grunt.registerTask('webserver', ['connect:devserver']);
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"grunt-contrib-jasmine-node": "~0.1.1",
"grunt-parallel": "~0.2.0",
"grunt-ddescribe-iit": "~0.0.1",
"grunt-merge-conflict": "~0.0.1"
"grunt-merge-conflict": "~0.0.1",
"promises-aplus-tests": "~1.3.2",
"grunt-shell": "~0.3.1"
},
"licenses": [
{
Expand Down
15 changes: 15 additions & 0 deletions promise-test-adapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


var Q = qFactory(process.nextTick,null);

exports.fulfilled = Q.resolve;
exports.rejected = Q.reject;
exports.pending = function () {
var deferred = Q.defer();

return {
promise: deferred.promise,
fulfill: deferred.resolve,
reject: deferred.reject
};
};