Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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
18 changes: 5 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function(grunt) {
parallel: {
travis: {
tasks: [
util.parallelTask(['test:unit', 'test:promises-aplus'/*, 'tests:docs'*/], {stream: true}),
util.parallelTask(['test:unit', 'test:promises-aplus', 'tests:docs'], {stream: true}),
util.parallelTask(['test:e2e'])
]
}
Expand Down Expand Up @@ -77,7 +77,7 @@ module.exports = function(grunt) {
tests: {
jqlite: 'karma-jqlite.conf.js',
jquery: 'karma-jquery.conf.js',
//docs: 'karma-docs.conf.js',
docs: 'karma-docs.conf.js',
modules: 'karma-modules.conf.js'
},

Expand All @@ -86,7 +86,7 @@ module.exports = function(grunt) {
jqlite: 'karma-jqlite.conf.js',
jquery: 'karma-jquery.conf.js',
modules: 'karma-modules.conf.js',
//docs: 'karma-docs.conf.js'
docs: 'karma-docs.conf.js'
},


Expand Down Expand Up @@ -217,14 +217,6 @@ module.exports = function(grunt) {
},


// docs: {
// process: ['build/docs/*.html', 'build/docs/.htaccess']
// },

"jasmine_node": {
projectRoot: 'docs/spec'
},

"ddescribe-iit": {
files: [
'test/**/*.js',
Expand Down Expand Up @@ -286,11 +278,11 @@ module.exports = function(grunt) {


//alias tasks
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['jshint', 'package','test:unit','test:promises-aplus'/*, 'tests:docs'*/, 'test:protractor']);
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['jshint', 'package','test:unit','test:promises-aplus', 'tests:docs', 'test:protractor']);
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: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:protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'protractor:normal']);
grunt.registerTask('test:jq-protractor', 'Run the end to end tests against jquery with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'protractor:jquery']);
Expand Down
23 changes: 23 additions & 0 deletions docs/app/src/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
angular.module('docsApp', [
'ngRoute',
'ngCookies',
'ngSanitize',
'ngAnimate',
'DocsController',
'versionsData',
'pagesData',
'directives',
'errors',
'examples',
'search',
'tutorials',
'versions',
'bootstrap',
'bootstrapPrettify',
'ui.bootstrap.dropdown'
])


.config(function($locationProvider) {
$locationProvider.html5Mode(true).hashPrefix('!');
});
27 changes: 3 additions & 24 deletions docs/app/src/docs.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
angular.module('docsApp', [
'ngRoute',
'ngCookies',
'ngSanitize',
'ngAnimate',
'versionsData',
'pagesData',
'directives',
'errors',
'examples',
'search',
'tutorials',
'versions',
'bootstrap',
'bootstrapPrettify',
'ui.bootstrap.dropdown'
])


.config(function($locationProvider) {
$locationProvider.html5Mode(true).hashPrefix('!');
})

angular.module('DocsController', [])

.controller('DocsController', function($scope, $rootScope, $location, $window, $cookies, NG_PAGES, NG_NAVIGATION, NG_VERSION) {

Expand Down Expand Up @@ -52,7 +30,8 @@ angular.module('docsApp', [
};

$scope.afterPartialLoaded = function() {
$window._gaq.push(['_trackPageview', $location.path()]);
var pagePath = $scope.currentPage ? $scope.currentPage.path : $location.path();
$window._gaq.push(['_trackPageview', pagePath]);
};

/** stores a cookie that is used by apache to decide which manifest ot send */
Expand Down
33 changes: 33 additions & 0 deletions docs/app/test/docsSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
describe("DocsController", function() {
var $scope;

angular.module('fake', [])
.value('$cookies', {})
.value('NG_PAGES', {})
.value('NG_NAVIGATION', {})
.value('NG_VERSION', {});

beforeEach(module('fake', 'DocsController'));
beforeEach(inject(function($rootScope, $controller) {
$scope = $rootScope;
$controller('DocsController', { $scope: $scope });
}));


describe('afterPartialLoaded', function() {
it("should update the Google Analytics with currentPage path if currentPage exists", inject(function($window) {
$window._gaq = [];
$scope.currentPage = { path: 'a/b/c' };
$scope.afterPartialLoaded();
expect($window._gaq.pop()).toEqual(['_trackPageview', 'a/b/c']);
}));


it("should update the Google Analytics with $location.path if currentPage is missing", inject(function($window, $location) {
$window._gaq = [];
spyOn($location, 'path').andReturn('x/y/z');
$scope.afterPartialLoaded();
expect($window._gaq.pop()).toEqual(['_trackPageview', 'x/y/z']);
}));
});
});
19 changes: 0 additions & 19 deletions gen_docs.sh

This file was deleted.

6 changes: 3 additions & 3 deletions jenkins_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ grunt ci-checks package --no-color

mkdir -p test_out

# DOCS generator unit tests #
grunt test:docgen --no-color

# UNIT TESTS #
grunt test:unit --browsers $BROWSERS --reporters=dots,junit --no-colors --no-color

# END TO END TESTS #
grunt test:ci-protractor

# DOCS APP TESTS #
grunt test:docs --browsers $BROWSERS --reporters=dots,junit --no-colors --no-color

# Promises/A+ TESTS #
grunt test:promises-aplus --no-color

Expand Down
23 changes: 2 additions & 21 deletions karma-docs.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,10 @@ module.exports = function(config) {

config.set({
files: [
'build/docs/components/jquery.js',
'test/jquery_remove.js',

'build/angular.js',
'build/angular-cookies.js',
'build/angular-resource.js',
'build/angular-touch.js',
'build/angular-sanitize.js',
'build/angular-route.js',
'build/angular-animate.js',
'build/angular-mocks.js',

'build/docs/components/lunr.js',
'build/docs/components/google-code-prettify.js',
'build/docs/components/marked.js',

'build/docs/components/angular-bootstrap.js',
'build/docs/components/angular-bootstrap-prettify.js',
'build/docs/js/docs.js',
'build/docs/docs-data.js',

'docs/component-spec/mocks.js',
'docs/component-spec/*.js'
'docs/app/src/**/*.js',
'docs/app/test/**/*Spec.js'
],

junitReporter: {
Expand Down
2 changes: 1 addition & 1 deletion scripts/travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`

if [ $JOB = "unit" ]; then
grunt ci-checks
#grunt test:docgen
grunt test:promises-aplus
grunt test:unit --browsers SL_Chrome,SL_Safari,SL_Firefox,SL_IE_8,SL_IE_9,SL_IE_10,SL_IE_11 --reporters dots
grunt test:docs --browsers SL_Chrome,SL_Safari,SL_Firefox,SL_IE_8,SL_IE_9,SL_IE_10,SL_IE_11 --reporters dots
elif [ $JOB = "e2e" ]; then
export GRUNT_TARGET="test:protractor"
if [ $JQVERSION = "jquery" ]; then
Expand Down