(
filePath: string,
options: Options = {},
{multiplePasses = false} = {}
)
| 280 | let cacheBust = 1 |
| 281 | |
| 282 | function transform( |
| 283 | filePath: string, |
| 284 | options: Options = {}, |
| 285 | {multiplePasses = false} = {} |
| 286 | ) { |
| 287 | function getPluginConfig() { |
| 288 | return [plugin, options, Date.now() + '' + ++cacheBust] |
| 289 | } |
| 290 | |
| 291 | return transformFileSync(filePath, { |
| 292 | presets: [ |
| 293 | [ |
| 294 | '@babel/preset-env', |
| 295 | { |
| 296 | targets: { |
| 297 | node: '14', |
| 298 | esmodules: true, |
| 299 | }, |
| 300 | modules: false, |
| 301 | useBuiltIns: false, |
| 302 | ignoreBrowserslistConfig: true, |
| 303 | }, |
| 304 | ], |
| 305 | '@babel/preset-react', |
| 306 | ], |
| 307 | plugins: multiplePasses |
| 308 | ? [getPluginConfig(), getPluginConfig()] |
| 309 | : [getPluginConfig()], |
| 310 | })! |
| 311 | } |
| 312 | |
| 313 | test('$t with no arguments', () => { |
| 314 | expect(transformAndCheck('shorthandT')).toEqual({ |
no test coverage detected