Skip to content

Commit

Permalink
Merge pull request #294 from ever-co/fix/export-yaml-flat
Browse files Browse the repository at this point in the history
Fix/YAML flat export unit test issue
  • Loading branch information
evereq committed Jan 31, 2022
2 parents 7ed16dc + a235ba8 commit c1725f3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/src/formatters/fixtures/simple-flat.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
term.one: 'Current Plan: {{ project.plan.name }}'
term two: '{VAR_PLURAL, plural, =0 {locales} =1 {locale} other {locales} }'
TERM_THREE: Export format...
'term:four': hello there you\nthis should be in a newline
term:four: hello there you\nthis should be in a newline
2 changes: 1 addition & 1 deletion api/src/formatters/fixtures/simple-nested.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ term:
one: 'Current Plan: {{ project.plan.name }}'
term two: '{VAR_PLURAL, plural, =0 {locales} =1 {locale} other {locales} }'
TERM_THREE: Export format...
'term:four': hello there you\nthis should be in a newline
term:four: hello there you\nthis should be in a newline
4 changes: 2 additions & 2 deletions api/src/formatters/yaml-flat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test('should fail if file is malformed, invalid or empty', async () => {
});

test('should export yaml files', async () => {
const result = await yamlFlatExporter(simpleFormatFixture);
const expected = loadFixture('simple-flat.yaml');
const result = (await yamlFlatExporter(simpleFormatFixture)).toString().split(/\r?\n/).filter(Boolean);
const expected = loadFixture('simple-flat.yaml').split(/\r?\n/).filter(Boolean);
expect(result).toEqual(expected);
});
4 changes: 2 additions & 2 deletions api/src/formatters/yaml-nested.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test('should fail if file is malformed, invalid or empty', async () => {
});

test('should export yaml nested files', async () => {
const result = await yamlNestedExporter(simpleFormatFixture);
const expected = loadFixture('simple-nested.yaml');
const result = (await yamlNestedExporter(simpleFormatFixture)).toString().split(/\r?\n/).filter(Boolean);
const expected = loadFixture('simple-nested.yaml').split(/\r?\n/).filter(Boolean);
expect(result).toEqual(expected);
});

0 comments on commit c1725f3

Please sign in to comment.