Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Wrong imports defined in tests/index.spec.ts #9

Closed
1 task done
JUNNNI opened this issue Nov 23, 2022 · 2 comments
Closed
1 task done

[BUG]: Wrong imports defined in tests/index.spec.ts #9

JUNNNI opened this issue Nov 23, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@JUNNNI
Copy link

JUNNNI commented Nov 23, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

First of all, thank you very much for that repo, it's very useful.

I noticed that some of the imports located in the index.spec.ts are wrong.
See https://github.com/snyk-labs/modern-npm-package/blob/main/tests/index.spec.ts#L5

Indeed, I guess it should be

import { helloWorld, goodBye } from '../src';
import commonPackage from '../src';

// instead of 

import { helloWorld, goodBye } from '../index';
import npmPackage from '../index';

Steps To Reproduce

  • Follow the installation guidelines from the README.md
  • Run npm test
  • Will results into the following error tests/index.spec.ts:5:27 - error TS2307: Cannot find module '../index' or its corresponding type declarations.

Additional Information

No response

@JUNNNI JUNNNI added the bug Something isn't working label Nov 23, 2022
@leonardo-czanoch
Copy link

You probably have figure it out already, it should be:

import { helloWorld, goodBye } from '../src/index';
import npmPackage from '../src/index';

// instead of

import { helloWorld, goodBye } from '../index';
import npmPackage from '../index';

The owner has forsaken the newbies like us.

@clarkio
Copy link
Collaborator

clarkio commented Mar 10, 2023

This has been fixed now in #7. Thank you all for bringing this to our attention 👍

@clarkio clarkio closed this as completed Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants