-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: incorrect error thrown for transliteration failures (#1542)
This leads to downstream tools reacting incorrectly. While both errors "Unsupported language" & "Transliteration error" indicate a fix is required by the assembly producer, the reaction might be handled differently by the upstream tool. For example a "Transliteration error" should indicate to stop processing all other submodules.
- Loading branch information
Showing
3 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ import * as child from 'child_process'; | |
import * as os from 'os'; | ||
import * as path from 'path'; | ||
import * as fs from 'fs-extra'; | ||
import { Language, Documentation, UnInstallablePackageError, CorruptedAssemblyError, LanguageNotSupportedError } from '../../../src'; | ||
import { Language, Documentation, UnInstallablePackageError, CorruptedAssemblyError, LanguageNotSupportedError, TransliterationError } from '../../../src'; | ||
import { extractPackageName } from '../../../src/docgen/view/documentation'; | ||
import { Assemblies } from '../assemblies'; | ||
|
||
|
@@ -269,10 +269,10 @@ test('throws unsupported language with invalid config', async () => { | |
await expect(docs.toJson({ language: Language.GO })).rejects.toThrowError(LanguageNotSupportedError); | ||
}); | ||
|
||
test('throws unsupported language when tablet was generated before rosetta supported go', async () => { | ||
test('throws transliteration error when tablet was generated before rosetta supported go', async () => { | ||
const docs = await Documentation.forPackage('[email protected]', { verbose: false }); | ||
await expect(docs.toMarkdown({ language: Language.GO })).rejects.toThrowError(LanguageNotSupportedError); | ||
await expect(docs.toJson({ language: Language.GO })).rejects.toThrowError(LanguageNotSupportedError); | ||
await expect(docs.toMarkdown({ language: Language.GO })).rejects.toThrowError(TransliterationError); | ||
await expect(docs.toJson({ language: Language.GO })).rejects.toThrowError(TransliterationError); | ||
}); | ||
|
||
test('does not throw if unrelated assembly is corrupted', async () => { | ||
|