Skip to content

Commit

Permalink
fix(aws-cdk): fix YAML line wrapping issue (#1334)
Browse files Browse the repository at this point in the history
Fix the issue where incorrect UserData was generated by updating to a newer version of the yaml library.

Fixes #1309.
  • Loading branch information
rix0rrr authored Dec 12, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 3076070 commit 48b9bdd
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/applet-js/package.json
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
"@aws-cdk/cdk": "^0.19.0",
"fs-extra": "^7.0.0",
"source-map-support": "^0.5.6",
"yaml": "^1.0.1"
"yaml": "^1.1.0"
},
"repository": {
"url": "https://github.com/awslabs/aws-cdk.git",
3 changes: 2 additions & 1 deletion packages/aws-cdk/package.json
Original file line number Diff line number Diff line change
@@ -63,7 +63,8 @@
"request": "^2.83.0",
"semver": "^5.5.0",
"source-map-support": "^0.5.6",
"yaml": "^1.0.1",
"table": "^5.1.0",
"yaml": "^1.1.0",
"yargs": "^9.0.1"
},
"repository": {
16 changes: 15 additions & 1 deletion packages/aws-cdk/test/test.yaml.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Test } from 'nodeunit';
import { toYAML } from '../lib/serialize';
import { fromYAML, toYAML } from '../lib/serialize';

// Preferred quote of the YAML library
const q = '"';
@@ -64,4 +64,18 @@ export = {

test.done();
},

'validate emission of very long lines'(test: Test) {
const template = {
Field: ' very long line that starts with a space. very long line that starts with a space. start on a new line'
};

const output = toYAML(template);

const parsed = fromYAML(output);

test.deepEqual(template, parsed);

test.done();
}
};

0 comments on commit 48b9bdd

Please sign in to comment.