Forked from busypeoples/AngularJS-ES6-Test-Skeleton
Last active
June 30, 2017 19:37
-
-
Save madhums/2e9fb4138b6de6496b8f to your computer and use it in GitHub Desktop.
Revisions
-
busypeoples revised this gist
Mar 13, 2015 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,11 @@ ###Example Structure src/ test/ views/ karma.conf.js Module.js -
busypeoples revised this gist
Mar 13, 2015 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ -
busypeoples revised this gist
Mar 13, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -- -
busypeoples revised this gist
Mar 13, 2015 . 2 changed files with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ import HelloWorldDirective from './src/HelloWorldDirective'; angular.module('app', []) .directive('helloWorld', HelloWorldDirective); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,4 +5,5 @@ src/ test/ views/ karma.conf.js Module.js -
busypeoples revised this gist
Mar 13, 2015 . 2 changed files with 8 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ ###Quick set up for writing AngularJS tests in ES6 using Karma, Jasmine, Browserify and Stringify. ###Example Structure src/ test/ views/ karma.conf.js -
busypeoples revised this gist
Mar 13, 2015 . 5 changed files with 5 additions and 1 deletion.There are no files selected for viewing
File renamed without changes.File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,6 @@ Quick set up for writing AngularJS tests in ES6 using Karma, Jasmine, Browserify and Stringify. Example Structure src/ test/ File renamed without changes.File renamed without changes. -
busypeoples created this gist
Mar 13, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ /** src/HelloWorldDirective.js **/ import helloWorldTemplate from './../views/hello-world.html'; class HelloWorldController { constructor() { this.greet = 'Hello'; } } function HelloWorldDirective() { return { scope: { name: '@' }, controller: HelloWorldController, controllerAs: 'ctrl', bindToController: true, replace: true, template: helloWorldTemplate } } export default HelloWorldDirective; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ /** test/HelloWorldDirective.js **/ describe('The HelloWorldDirective', () => { let element, scope; beforeEach(angular.mock.module('app')); beforeEach(inject(function(_$rootScope_,_$compile_) { let $rootScope = _$rootScope_, $compile = _$compile_; scope = $rootScope.$new(); element = angular.element('<hello-world data-name="{{ name }}"></hello-world>'); $compile(element)(scope); })); it('should display the defined name', () => { let name = 'Some rendered text'; scope.name = name; scope.$digest(); expect(element.text()).toContain(`Hello ${name}`); }); }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ ###Quick set up for writing AngularJS tests in ES6 using Karma, Jasmine, Browserify and Stringify. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ <!-- views/hello-world.html --> <div>{{ ctrl.greet }} {{ ctrl.name }}</div> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ module.exports = function(config) { config.set({ basePath: '', frameworks: ['browserify', 'jasmine'], files: [ 'node_modules/angular/angular.min.js', 'node_modules/angular-mocks/angular-mocks.js', 'Module.js', 'views/*', 'src/**/*.js', 'test/**/*test.js' ], exclude: [ ], preprocessors: { 'Module.js': ['browserify'], 'views/*' : ['browserify'], 'src/**/*.js': ['browserify'], 'test/**/*test.js': ['browserify'] }, browserify: { debug: true, transform: ['babelify', 'stringify'] }, reporters: ['progress'], port: 9876, colors: true, logLevel: config.LOG_DEBUG, autoWatch: true, browsers: ['PhantomJS'], singleRun: false }); };