You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This stopped working on 3.1.0 and I need to require('./index.js') which is a bit cumbersome and also in nodejs it's standard to resolve require('.') to the sibling index.js file.
This is an example breaking test, which passes before 7dc2da6
describe('when requiring a sibling index.js',()=>{constsiblingAliasTransformOpts={babelrc: false,plugins: [[plugin,{root: ['./src'],}],],};it('should resolve an index.js on a folder name',()=>{testWithImport('.','.',siblingAliasTransformOpts,);});});
● module-resolver › when requiring a sibling index.js › should resolve an index.js on a folder name
expect(received).toBe(expected) // Object.is equality
Expected value to be:
"import something from \".\";"
Received:
"import something from \"./src\";"
10 | const result = transform(code, transformerOpts);
11 |
> 12 | expect(result.code).toBe(`import something from "${output}";`);
13 | }
14 |
15 | describe('exports', () => {
I'm happy to help with a PR or to complement with more details. Thanks!
The text was updated successfully, but these errors were encountered:
Thanks for volunteering to create a PR - that's the spirit! I'd only recommend adding filename to the test options (can point e.g. to './test/testproject/src/components/App.js' because it has a sibling index.js file) and using './test/testproject/src' as root.
It seems that requiring a sibling
index.js
file in a folder with therequire('.')
notation stopped working since #253I usually have the following structure for components:
and I'd require the file on
spec.js
with:This stopped working on 3.1.0 and I need to
require('./index.js')
which is a bit cumbersome and also in nodejs it's standard to resolverequire('.')
to the sibling index.js file.This is an example breaking test, which passes before 7dc2da6
I'm happy to help with a PR or to complement with more details. Thanks!
The text was updated successfully, but these errors were encountered: