Skip to content

Commit

Permalink
fix(init): Do not escape author field in package.json (#55)
Browse files Browse the repository at this point in the history
Fixes #52
  • Loading branch information
LukasHechenberger committed Jun 13, 2017
1 parent 7a1d548 commit 160fffc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion res/init/templates/general/package.json
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "{{author}}",
"author": "{{{author}}}",
"license": "UNLICENSED",
"private": true,
"devDependencies": {
Expand Down
15 changes: 15 additions & 0 deletions test/src/init/InitTask.spec.js
Expand Up @@ -85,6 +85,21 @@ describe('InitTask', function() {
});
});

it('should not escape author field in package.json (#52)', function() {
const author = 'Sample name <mail@example.com>';

return InitTask.run({ configLang: 'es2015', author })
.then(() => {
expect(srcSpy.callCount, 'to be greater than', 0);

const pkgOut = destSpy.args
.map(args => args[0])
.filter(f => f.relative === 'package.json')[0].contents.toString();

expect(JSON.parse(pkgOut).author, 'to equal', author);
});
});

function expectHandlingLangFiles(configLang) {
const files = readdirSync(
join(__dirname, '../../../res/init/templates/lang', configLang)
Expand Down

0 comments on commit 160fffc

Please sign in to comment.