Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/YAML flat export unit test issue #294

Merged
merged 2 commits into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});