forked from diegonetto/generator-ionic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed mocha test errors. Moved mocha timeout setting to package.json.
- Loading branch information
Showing
4 changed files
with
55 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,55 @@ | ||
/*global describe, beforeEach, it*/ | ||
/*global describe, it, beforeEach */ | ||
'use strict'; | ||
|
||
var path = require('path'); | ||
var path = require('path'); | ||
var helpers = require('yeoman-generator').test; | ||
|
||
describe('Ionic Framework Generator', function () { | ||
beforeEach(function (done) { | ||
this.timeout(60000); | ||
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) { | ||
if (err) { | ||
return done(err); | ||
} | ||
|
||
this.app = helpers.createGenerator('ionic:app', [ | ||
'../../app' | ||
]); | ||
done(); | ||
}.bind(this)); | ||
}); | ||
describe('Ionic Generator', function () { | ||
|
||
beforeEach(function (done) { | ||
|
||
helpers | ||
.testDirectory(path.join(__dirname, 'temp'), function (err) { | ||
if (err) { | ||
return done(err); | ||
} | ||
this.app = helpers.createGenerator( | ||
'ionic:app', [ | ||
'../../app' | ||
]); | ||
|
||
done(); | ||
}.bind(this)); | ||
}); | ||
|
||
it('creates expected files', function () { | ||
|
||
it('creates expected files', function (done) { | ||
this.timeout(60000); | ||
var expected = [ | ||
// add files you expect to exist here. | ||
'.jshintrc', | ||
'.editorconfig' | ||
]; | ||
|
||
helpers.mockPrompt(this.app, { | ||
compass: false, | ||
plugins: ['com.ionic.keyboard'], | ||
starter: 'Tabs' | ||
}); | ||
this.app.init = function () {}; | ||
this.app.run({}, function () { | ||
helpers.assertFiles(expected); | ||
done(); | ||
}); | ||
var expected = [ | ||
'config.xml', | ||
'www/index.html', | ||
'www/js/index.js', | ||
'.bowerrc', | ||
'.editorconfig', | ||
'.gitignore', | ||
'.jshintrc', | ||
'Gruntfile.js', | ||
'package.json', | ||
'bower.json' | ||
]; | ||
|
||
helpers.mockPrompt(this.app, { | ||
compass: false, | ||
plugins: ['com.ionic.keyboard'], | ||
starter: 'Tabs' | ||
}); | ||
|
||
this.app.options['skip-install'] = false; | ||
|
||
this.app.run({}, function () { | ||
helpers.assertFile(expected); | ||
done(); | ||
}) | ||
|
||
}); | ||
}); | ||
|
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
/*global describe, beforeEach, it*/ | ||
/*global describe, it, beforeEach */ | ||
'use strict'; | ||
|
||
var assert = require('assert'); | ||
var assert = require('yeoman-generator').assert; | ||
|
||
describe('ionic generator', function () { | ||
describe('Ionic Generator load test', function () { | ||
it('can be imported without blowing up', function () { | ||
var app = require('../app'); | ||
assert(app !== undefined); | ||
assert(require('../app') !== undefined); | ||
}); | ||
}); | ||
}); |