Skip to content

Commit

Permalink
fix: failing tests
Browse files Browse the repository at this point in the history
abs paths were not imported in windows
  • Loading branch information
aladdin-add committed Dec 16, 2021
1 parent ceea0c4 commit 890fe07
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/errors/transformErrorMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { invertObject } from './invertObject';
import { evalToString } from './evalToString';
import { addDefault } from '@babel/helper-module-imports';
import { paths } from '../constants';
import { pathToFileURL } from 'url';

export default function transformErrorMessages(babel: any) {
const t = babel.types;
Expand Down Expand Up @@ -52,7 +53,7 @@ export default function transformErrorMessages(babel: any) {
// Import ReactError
const reactErrorIdentfier = addDefault(
path,
paths.appRoot + '/errors/ErrorDev.js',
pathToFileURL(paths.appRoot + '/errors/ErrorDev.js'),
{
nameHint: 'InvariantError',
}
Expand Down Expand Up @@ -117,7 +118,7 @@ export default function transformErrorMessages(babel: any) {
// Import ReactErrorProd
const reactErrorProdIdentfier = addDefault(
path,
paths.appRoot + '/errors/ErrorProd.js',
pathToFileURL(paths.appRoot + '/errors/ErrorProd.js'),
{
nameHint: 'InvariantErrorProd',
}
Expand Down

0 comments on commit 890fe07

Please sign in to comment.