Skip to content

Commit

Permalink
Fix generator for Flight 1.2.x
Browse files Browse the repository at this point in the history
Close #46
Close #47
  • Loading branch information
necolas committed Aug 20, 2014
1 parent 52a6164 commit c4e95a3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 65 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ define(function (require) {
return defineComponent(tweetBox);

function tweetBox() {
this.defaultAttrs({});
this.attributes({});
this.after('initialize', function () {});
}
});
Expand All @@ -160,7 +160,7 @@ And the test file `test/spec/component/tweet_box.spec.js`:
describeComponent('component/tweet_box', function () {
// Initialize the component and attach it to the DOM
beforeEach(function () {
setupComponent();
this.setupComponent();
});

it('should be defined', function () {
Expand Down Expand Up @@ -190,7 +190,7 @@ define(function (require) {
return withTweetActions;

function withTweetActions() {
this.defaultAttrs({});
this.attributes({});
this.after('initialize', function () {});
}
});
Expand All @@ -202,7 +202,7 @@ And the test file `test/spec/component/with_tweet_box.spec.js`:
describeMixin('component/with_tweet_box', function () {
// Initialize the component and attach it to the DOM
beforeEach(function () {
setupComponent();
this.setupComponent();
});

it('should be defined', function () {
Expand Down
4 changes: 2 additions & 2 deletions lib/templates/application/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"version": "0.0.0",
"dependencies": {
"jquery": "2.x.x",
"flight": "~1.1.0",
"flight": "1.x.x",
"requirejs": "~2.1.5"<% if (normalize) { %>,
"normalize-css": "3.x.x"<% } %><% if (bootstrap) { %>,
"components-bootstrap": "3.x.x"<% } %>
},
"devDependencies": {
"jasmine-flight": "~2.2.0"
"jasmine-flight": "3.x.x"
}
}
62 changes: 13 additions & 49 deletions lib/templates/application/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,67 +7,31 @@ module.exports = function (config) {
'use strict';

config.set({

// base path, that will be used to resolve files and exclude
autoWatch: true,
basePath: '',

// frameworks to use
frameworks: ['jasmine'],

// list of files / patterns to load in the browser
browsers: [process.env.TRAVIS ? 'Firefox' : 'Chrome'],
captureTimeout: 5000,
exclude: [
'app/js/main.js'
],
files: [
// loaded without require
'app/bower_components/es5-shim/es5-shim.js',
'app/bower_components/es5-shim/es5-sham.js',
'app/bower_components/jquery/dist/jquery.js',
'app/bower_components/jasmine-jquery/lib/jasmine-jquery.js',
'app/bower_components/jasmine-flight/lib/jasmine-flight.js',

// hack to load RequireJS after the shim libs
'node_modules/requirejs/require.js',
'node_modules/karma-requirejs/lib/adapter.js',

// loaded with require
{pattern: 'app/bower_components/flight/**/*.js', included: false},
{pattern: 'app/js/**/*.js', included: false},
{pattern: 'test/spec/**/*.spec.js', included: false},

// test config
'test/test-main.js'
],

// list of files to exclude
exclude: [
'app/js/main.js'
frameworks: [
'jasmine',
'requirejs'
],

// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['progress'],

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,

// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: [
'Chrome'
],

// If browser does not capture in given timeout [ms], kill it
captureTimeout: 5000,

// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,

// Karma will report all the tests that are slower than given time limit (in
// ms).
reportSlowerThan: 500
reporters: [process.env.TRAVIS ? 'dots' : 'progress'],
reportSlowerThan: 500,
singleRun: false
});
};
12 changes: 5 additions & 7 deletions lib/templates/application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@
"gulp": "~3.4.0",
"gulp-livereload": "~0.2.0",
"requirejs": "~2.1.11",
"karma": "~0.10.0",
"karma-jasmine": "~0.1.0",
"karma": "~0.12.0",
"karma-cli": "~0.0.4",
"karma-jasmine": "~0.2.0",
"karma-requirejs": "~0.2.1",
"karma-chrome-launcher": "~0.1.0",
"karma-ie-launcher": "~0.1.1",
"karma-firefox-launcher": "~0.1.0",
"karma-phantomjs-launcher": "~0.1.0",
"karma-safari-launcher": "~0.1.1",
"node-static": "~0.7.3",
"tiny-lr": "0.0.5"
"tiny-lr": "~0.0.5"
},
"scripts": {
"livereload": "gulp",
"server": "static app",
"test": "karma start --single-run --browsers PhantomJS",
"test": "karma start --single-run",
"watch": "npm run server > server.log & npm run livereload",
"watch-test": "karma start"
}
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define(function (require) {
*/

function <%= _.camelize(name) %>() {
this.defaultAttrs({
this.attributes({

});

Expand Down
2 changes: 1 addition & 1 deletion lib/templates/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ define(function (require) {
*/

function with<%= _.classify(name) %>() {
this.defaultAttrs({
this.attributes({

});

Expand Down
2 changes: 1 addition & 1 deletion lib/templates/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe<%= _.classify(type) %>('<%= requirePath %>', function () {

// Initialize the component and attach it to the DOM
beforeEach(function () {
setupComponent();
this.setupComponent();
});

it('should be defined', function () {
Expand Down

0 comments on commit c4e95a3

Please sign in to comment.