File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,13 @@ class Translation {
1616
1717 loadVocabulary ( vocabularyFile ) {
1818 if ( ! vocabularyFile ) return
19- const filePath = path . join ( store . codeceptDir , vocabularyFile )
19+
20+ let filePath ;
21+ if ( path . isAbsolute ( vocabularyFile ) ) {
22+ filePath = vocabularyFile ;
23+ } else {
24+ filePath = path . join ( store . codeceptDir , vocabularyFile ) ;
25+ }
2026
2127 try {
2228 const require = createRequire ( import . meta. url )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { resolveImportModulePath } from '../../lib/utils.js'
1414const realDummyPagePath = path . resolve ( __dirname , '../data/dummy_page.js' ) ;
1515const realIPath = path . resolve ( __dirname , '../data/I.js' ) ;
1616const realHelperPath = path . resolve ( __dirname , '../data/helper.js' ) ;
17+ const realVocabulariesPath = path . resolve ( __dirname , '../data/custom_vocabulary.json' ) ;
1718
1819describe ( 'Container' , ( ) => {
1920 before ( ( ) => {
@@ -82,7 +83,7 @@ describe('Container', () => {
8283 } )
8384
8485 it ( 'should load custom translation with vocabularies' , async ( ) => {
85- await container . create ( { translation : 'my' , vocabularies : [ 'data/custom_vocabulary.json' ] } )
86+ await container . create ( { translation : 'my' , vocabularies : [ realVocabulariesPath ] } )
8687 expect ( container . translation ( ) ) . to . be . instanceOf ( Translation )
8788 expect ( container . translation ( ) . loaded ) . to . be . true
8889 const translation = container . translation ( )
You can’t perform that action at this time.
0 commit comments