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

[Docs] What is the practical difference of using @ava/typescript? Should I expect automagic source mapping? #19

Closed
papb opened this issue Mar 21, 2020 · 5 comments

Comments

@papb
Copy link

papb commented Mar 21, 2020

Note: I have phrased this issue mostly as a question, but please look at it as a request for documentation improvement - I looked around but didn't find anything on this.


My @papb/zip module is written in TypeScript and I currently test it with ava, but without @ava/typescript.

Today I tried to configure @ava/typescript on it. However, although it works, I could not see any practical difference. I thought perhaps source mapping would work automagically, but I still get outputs based on the compiled file.

For example, adding a simple failing test as follows:

// test/test.ts
import test from 'ava';

test('Tests not ready...', t => {
	t.fail();
});

Still yields:

image

Note the presence of ava_1.default.

This was the only thing I was expecting to change. If this still works as before, what is the practical advantage of starting to use @ava/typescript?

@novemberborn
Copy link
Member

You can run specific test files based on their source location, rather than the build output:

npx ava test/test.ts

Which is quite nice if you have multiple test files.

#12 will let AVA compile your sources before running tests.

With regards to source maps, it's probably best to install source-map-support and then require source-map-support/register through AVA's require option.

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)

@papb
Copy link
Author

papb commented Apr 3, 2020

Thanks for the fast response, sorry to take long to reply. What you said clarified it to me. Also thank you very much for the tip on source maps! Is this documented somewhere?

@novemberborn
Copy link
Member

thank you very much for the tip on source maps! Is this documented somewhere?

@papb I don't think so… I've opened #20. Perhaps you'd be interested in doing a PR for that? 😄

@jonsadka
Copy link

This was helpful and probably worthy of adding to the README.md :)

@novemberborn
Copy link
Member

This was helpful and probably worthy of adding to the README.md :)

@jonsadka Yes, see #20.

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

No branches or pull requests

3 participants