MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / loadVocabulary

Method loadVocabulary

lib/translation.js:17–34  ·  view source on GitHub ↗
(vocabularyFile)

Source from the content-addressed store, hash-verified

15 }
16
17 loadVocabulary(vocabularyFile) {
18 if (!vocabularyFile) return
19
20 let filePath;
21 if (path.isAbsolute(vocabularyFile)) {
22 filePath = vocabularyFile;
23 } else {
24 filePath = path.join(store.codeceptDir, vocabularyFile);
25 }
26
27 try {
28 const require = createRequire(import.meta.url)
29 const vocabulary = require(filePath)
30 this.vocabulary = merge(this.vocabulary, vocabulary)
31 } catch (err) {
32 throw new Error(`Can't load vocabulary from ${filePath}; ${err}`)
33 }
34 }
35
36 value(val) {
37 return this.vocabulary[val]

Callers 1

loadTranslationFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected