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

Add tests for Vue #418

Merged
merged 3 commits into from
May 30, 2024
Merged

Add tests for Vue #418

merged 3 commits into from
May 30, 2024

Conversation

fdc-viktor-luft
Copy link
Collaborator

@fdc-viktor-luft fdc-viktor-luft commented May 23, 2024

  • Including a fresh install of the current dependencies to include the latest updates of detective-vue2 -> Hence, simplification of package-lock.json.
  • Including a syntax fix for the ESM exports

@fdc-viktor-luft
Copy link
Collaborator Author

@pahen I left a TODO comment in the test as I couldn't get it to work for other dependencies like existing ".vue" files to be listed. There might be some config that I couldn't find. I tried ts: {mixedImports: true} or adding all possible file extensions or turning on the includeNpm.

Also, running this single test fails via npm run mocha -- -g Vue with a babel-parsing error, but running npm run mocha works for some reason.

Maybe you just know the trick 😛

@pahen
Copy link
Owner

pahen commented May 24, 2024

@pahen I left a TODO comment in the test as I couldn't get it to work for other dependencies like existing ".vue" files to be listed. There might be some config that I couldn't find. I tried ts: {mixedImports: true} or adding all possible file extensions or turning on the includeNpm.

Also, running this single test fails via npm run mocha -- -g Vue with a babel-parsing error, but running npm run mocha works for some reason.

Maybe you just know the trick 😛

Not sure why but specifying the tsConfig fixes both the test and the issue with running a single test  🤷‍♂️

Try this:

const tsConfig = {
	compilerOptions: {
		allowJs: true,
		esModuleInterop: true,
		jsx: 'preserve',
		module: 'esnext',
		moduleResolution: 'node',
		noEmit: true,
		noImplicitAny: true,
		strict: true,
		target: 'esnext'
	}
};

madge(dir + '/BasicComponent.vue', {tsConfig}).then((res) => {

@fdc-viktor-luft
Copy link
Collaborator Author

fdc-viktor-luft commented May 25, 2024

I could even reduce the TS config provided to a very minimal version to make it work. Can we make a plan to publish v8?

I'd still like to do some additional cleanups before publishing though. E.g. #419 and some more dependency updates.

@fdc-viktor-luft fdc-viktor-luft merged commit 6612178 into pahen:master May 30, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants