-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Reduce language detection threshold for MeetingTemplates (#9855)
- Loading branch information
1 parent
4604716
commit 03bd7dd
Showing
4 changed files
with
93 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import {inferLanguage} from '../inferLanguage' | ||
|
||
test('should infer the language of a string', () => { | ||
expect( | ||
inferLanguage( | ||
` | ||
Weighted Shortest Job First | ||
planning poker, sprint poker, estimation | ||
Story Points | ||
Fibonacci | ||
1, 2, 3, 5, 8, 13, 21, 34, ?, Pass | ||
Story Value | ||
Fibonacci | ||
1, 2, 3, 5, 8, 13, 21, 34, ?, Pass | ||
`, | ||
10 | ||
) | ||
).toBe('en') | ||
/* ideally this would be detected as 'en', but it isn't | ||
expect( | ||
inferLanguage( | ||
` | ||
*New Template #1 | ||
New prompt | ||
`, | ||
10 | ||
) | ||
).toBe('en') | ||
*/ | ||
expect( | ||
inferLanguage( | ||
` | ||
Was lief gut? | ||
Höhepunkte | ||
`, | ||
10 | ||
) | ||
).not.toBe('en') | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const tsJestPresets = require('ts-jest/presets') | ||
|
||
module.exports = { | ||
testEnvironment: 'node', | ||
transform: { | ||
'^.+\\.tsx?$': [ | ||
'ts-jest', | ||
{ | ||
diagnostics: false | ||
} | ||
] | ||
}, | ||
modulePaths: ['<rootDir>/packages/'], | ||
moduleNameMapper: { | ||
'server/(.*)': ['<rootDir>/$1'], | ||
'parabol-client/(.*)': ['<rootDir>/../client/$1'], | ||
'~/(.*)': ['<rootDir>/../client/$1'] | ||
}, | ||
testRegex: '/__tests__/.*.test\\.ts?$', | ||
clearMocks: true | ||
} |
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