fix: use location for language, not extension
Rather than relying on .lang.md this expects to find the English source challenge in /curriculum/challenges/english/<translationPath>
This commit is contained in:
@ -16,9 +16,10 @@ describe('translation parser', () => {
|
||||
return Promise.all([
|
||||
parseMarkdown(path.resolve(__dirname, '__fixtures__/combined.md')),
|
||||
parseTranslation(
|
||||
path.resolve(__dirname, '__fixtures__/challenge.english.md'),
|
||||
path.resolve(__dirname, '__fixtures__/challenge.chinese.md'),
|
||||
SIMPLE_TRANSLATION
|
||||
path.resolve(__dirname, '__fixtures__/english/challenge.md'),
|
||||
path.resolve(__dirname, '__fixtures__/chinese/challenge.md'),
|
||||
SIMPLE_TRANSLATION,
|
||||
'chinese'
|
||||
)
|
||||
]).then(xs => expect(xs[1]).toEqual(xs[0]));
|
||||
});
|
||||
@ -30,10 +31,11 @@ describe('translation parser', () => {
|
||||
parseTranslation(
|
||||
path.resolve(
|
||||
__dirname,
|
||||
'__fixtures__/challenge-html-comments.english.md'
|
||||
'__fixtures__/english/challenge-html-comments.md'
|
||||
),
|
||||
path.resolve(__dirname, '__fixtures__/challenge.chinese.md'),
|
||||
SIMPLE_TRANSLATION
|
||||
path.resolve(__dirname, '__fixtures__/chinese/challenge.md'),
|
||||
SIMPLE_TRANSLATION,
|
||||
'chinese'
|
||||
)
|
||||
]).then(xs => expect(xs[1]).toEqual(xs[0]));
|
||||
});
|
||||
@ -45,10 +47,11 @@ describe('translation parser', () => {
|
||||
parseTranslation(
|
||||
path.resolve(
|
||||
__dirname,
|
||||
'__fixtures__/challenge-jsx-comments.english.md'
|
||||
'__fixtures__/english/challenge-jsx-comments.md'
|
||||
),
|
||||
path.resolve(__dirname, '__fixtures__/challenge.chinese.md'),
|
||||
SIMPLE_TRANSLATION
|
||||
path.resolve(__dirname, '__fixtures__/chinese/challenge.md'),
|
||||
SIMPLE_TRANSLATION,
|
||||
'chinese'
|
||||
)
|
||||
]).then(xs => expect(xs[1]).toEqual(xs[0]));
|
||||
});
|
||||
@ -60,10 +63,11 @@ describe('translation parser', () => {
|
||||
parseTranslation(
|
||||
path.resolve(
|
||||
__dirname,
|
||||
'__fixtures__/challenge-js-comments.english.md'
|
||||
'__fixtures__/english/challenge-js-comments.md'
|
||||
),
|
||||
path.resolve(__dirname, '__fixtures__/challenge.chinese.md'),
|
||||
SIMPLE_TRANSLATION
|
||||
path.resolve(__dirname, '__fixtures__/chinese/challenge.md'),
|
||||
SIMPLE_TRANSLATION,
|
||||
'chinese'
|
||||
)
|
||||
]).then(xs => expect(xs[1]).toEqual(xs[0]));
|
||||
});
|
||||
@ -71,8 +75,8 @@ describe('translation parser', () => {
|
||||
return Promise.all([
|
||||
parseMarkdown(path.resolve(__dirname, '__fixtures__/combined.md')),
|
||||
parseTranslation(
|
||||
path.resolve(__dirname, '__fixtures__/challenge.english.md'),
|
||||
path.resolve(__dirname, '__fixtures__/challenge-stripped.chinese.md'),
|
||||
path.resolve(__dirname, '__fixtures__/english/challenge.md'),
|
||||
path.resolve(__dirname, '__fixtures__/chinese/challenge-stripped.md'),
|
||||
SIMPLE_TRANSLATION
|
||||
)
|
||||
]).then(xs => expect(xs[1]).toEqual(xs[0]));
|
||||
|
Reference in New Issue
Block a user