From 1e0cc762076faf49de3fe8324345085d2581f0af Mon Sep 17 00:00:00 2001 From: Dana Batali Date: Thu, 28 Jan 2021 16:39:23 -0800 Subject: [PATCH] enh(Development) allow for browser-testing of 'extra' language. (#2978) - Fix find default.txt for testing extra language. --- tools/lib/language.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/lib/language.js b/tools/lib/language.js index 5c6e73d14b..c4f8e57a44 100644 --- a/tools/lib/language.js +++ b/tools/lib/language.js @@ -44,7 +44,14 @@ class Language { } get samplePath() { - return `./test/detect/${this.name}/default.txt` + if (this.moduleDir) { + // this is the 'extras' case. + return `${this.moduleDir}/test/detect/${this.name}/default.txt`; + } + else { + // this is the common/built-in case. + return `./test/detect/${this.name}/default.txt`; + } } loadMetadata() {