-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: register lodash template loader in tests
- Loading branch information
Sandro Mesterheide
committed
Nov 26, 2024
1 parent
a25ba10
commit 774cb27
Showing
3 changed files
with
268 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
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 |
---|---|---|
@@ -1,12 +1,24 @@ | ||
const _ = require('lodash'); | ||
const pirates = require('pirates'); | ||
|
||
/** | ||
* Overrides the tsconfig used for the app. | ||
* In the test environment we need some tweaks. | ||
*/ | ||
|
||
const tsNode = require('ts-node'); | ||
const tsNode = require('ts-node'); | ||
|
||
tsNode.register({ | ||
tsNode.register({ | ||
files: true, | ||
transpileOnly: true, | ||
project: './tsconfig.spec.json' | ||
}); | ||
}); | ||
|
||
pirates.addHook((code) => { | ||
return 'export default ' + _.template(code, { | ||
evaluate: /\{%([\s\S]+?)%\}/g, | ||
interpolate: /\{\{([\s\S]+?)\}\}/g, | ||
escape: /\{\{\{([\s\S]+?)\}\}\}/g, | ||
variable: 'ctx' | ||
}); | ||
}, { exts: ['.ejs'] }); |
Oops, something went wrong.