-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to yeoman-generator 2.0 + latest generator scaffolding (pretti…
…er & cie)
- Loading branch information
Showing
9 changed files
with
5,485 additions
and
164 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage |
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,2 +1,2 @@ | ||
node_modules/ | ||
coverage/ | ||
node_modules | ||
coverage |
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 |
---|---|---|
|
@@ -3,23 +3,26 @@ var path = require('path'); | |
var assert = require('yeoman-assert'); | ||
var helpers = require('yeoman-test'); | ||
|
||
describe('license:app', function () { | ||
it('does not create new package.json', function () { | ||
return helpers.run(require.resolve('../app')) | ||
describe('license:app', function() { | ||
it('does not create new package.json', function() { | ||
return helpers | ||
.run(require.resolve('../app')) | ||
.withPrompts({ | ||
name: 'Rick', | ||
email: '[email protected]', | ||
website: 'http://example.com', | ||
license: 'MIT' | ||
}).then(function () { | ||
}) | ||
.then(function() { | ||
assert.file('LICENSE'); | ||
assert.noFile('package.json'); | ||
}); | ||
}); | ||
|
||
it('edit pre-existing package.json', function () { | ||
return helpers.run(require.resolve('../app')) | ||
.inTmpDir(function (dir) { | ||
it('edit pre-existing package.json', function() { | ||
return helpers | ||
.run(require.resolve('../app')) | ||
.inTmpDir(function(dir) { | ||
var done = this.async(); | ||
var fs = require('fs'); | ||
fs.writeFile(path.join(dir, 'package.json'), '{}', done); | ||
|
@@ -30,31 +33,34 @@ describe('license:app', function () { | |
website: 'http://example.com', | ||
license: 'MIT' | ||
}) | ||
.then(function () { | ||
.then(function() { | ||
assert.file('LICENSE'); | ||
assert.fileContent('package.json', '"license": "MIT"'); | ||
}); | ||
}); | ||
|
||
it('with author options: --name --email --website', function () { | ||
return helpers.run(require.resolve('../app')) | ||
it('with author options: --name --email --website', function() { | ||
return helpers | ||
.run(require.resolve('../app')) | ||
.withPrompts({ | ||
license: 'ISC' | ||
}) | ||
.withOptions({ | ||
name: 'Rick', | ||
email: '[email protected]', | ||
website: 'http://example.com' | ||
}).then(function () { | ||
}) | ||
.then(function() { | ||
assert.fileContent('LICENSE', 'ISC'); | ||
assert.fileContent('LICENSE', 'Rick <[email protected]> (http://example.com)'); | ||
assert.noFile('package.json'); | ||
}); | ||
}); | ||
|
||
it('makes npm module private when license selected is nolicense', function () { | ||
return helpers.run(require.resolve('../app')) | ||
.inTmpDir(function (dir) { | ||
it('makes npm module private when license selected is nolicense', function() { | ||
return helpers | ||
.run(require.resolve('../app')) | ||
.inTmpDir(function(dir) { | ||
var fs = require('fs'); | ||
fs.writeFileSync(path.join(dir, 'package.json'), '{}'); | ||
}) | ||
|
@@ -65,14 +71,15 @@ describe('license:app', function () { | |
licensePrompt: 'Choose a license', | ||
license: 'nolicense' | ||
}) | ||
.then(function () { | ||
.then(function() { | ||
assert.noFileContent('package.json', '"license"'); | ||
assert.fileContent('package.json', '"private": true'); | ||
}); | ||
}); | ||
|
||
it('--output change the destination directory', function () { | ||
return helpers.run(path.join(__dirname, '../app')) | ||
it('--output change the destination directory', function() { | ||
return helpers | ||
.run(path.join(__dirname, '../app')) | ||
.withOptions({ | ||
output: 'src/license.txt' | ||
}) | ||
|
@@ -83,7 +90,7 @@ describe('license:app', function () { | |
website: 'http://example.com', | ||
license: 'GPL-3.0' | ||
}) | ||
.then(function () { | ||
.then(function() { | ||
assert.file('src/license.txt'); | ||
assert.noFile('LICENSE'); | ||
}); | ||
|
Oops, something went wrong.