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

Type definitions #7

Closed
corbinu opened this issue Jan 26, 2018 · 14 comments
Closed

Type definitions #7

corbinu opened this issue Jan 26, 2018 · 14 comments

Comments

@corbinu
Copy link

corbinu commented Jan 26, 2018

Super excited to see this honestly have spent the last month looking for a new testing framework and this looks amazing. Would you be open to if I committed a type definition set?

@lorenzofox3
Copy link
Owner

hey sorry for the late reply I was in vacation. Sure. However please note I am currently working on a version 2 which will have exactly the same API than other tap frameworks such node-tap or tape (to make thing easier). Cheers

@corbinu
Copy link
Author

corbinu commented Feb 2, 2018

@lorenzofox3 No worries. Actually I ended up forking for the short term especially since the current default export is not compatible with es2015 Modules. Also I wanted to be able to transpile it to es3 so could do some browser tests in older versions of IE plus I wanted to add a few small features. Total lines still about the same. Happy to collaborate if your interested.

@corbinu corbinu closed this as completed Feb 5, 2018
@lorenzofox3
Copy link
Owner

default export is not compatible with es2015 Module

can you elaborate please ?

@corbinu
Copy link
Author

corbinu commented Feb 5, 2018

Sorry better way to put it is that an es2015 module can’t be just a function. A function can be the default export however.

Babel breaks the spec to get around this and there is some debate as to what all the changes will be to get node to support ES modules. However TypeScript makes it a rule to stay with the spec on everything. So in my version I changed it to just be ES modules and then used TypeScript to transpile down to ES3 and commonjs.

However the problem could be fixed a few other ways including just mapping the module.exports to module.exports.default

Happy to open a PR if you like.

@corbinu
Copy link
Author

corbinu commented Feb 8, 2018

@lorenzofox3 Does that make more sense? Get why you want to go more towards the tap API however.

@lorenzofox3
Copy link
Owner

Sorry better way to put it is that an es2015 module can’t be just a function. A function can be the default export however.

I am not sure ?

what about:

// myModule.js
export default function(){}

seems legit according to the spec

And indeed next api will be a single function

import test from 'zora';

test('foo', t=>{
  t.ok(true);
})

I should be done by the end of the week. I'll send you a notif for a beta review when I am done ;)

@corbinu
Copy link
Author

corbinu commented Feb 9, 2018

Nvm your right your my fault actually looks like it was a bug in rollup when it was going the conversion to commonjs that has since been fixed.

@lorenzofox3
Copy link
Owner

@corbinu The new pre major release is available. Can you try a little bit and tell me what you think ? Thanks

@corbinu
Copy link
Author

corbinu commented Feb 9, 2018

Sure will do!

@styfle
Copy link
Contributor

styfle commented Jun 27, 2018

I would be interested in typescript definitions 👍

I got referred to this project from tape-modern here: Rich-Harris/tape-modern#2

@lorenzofox3
Copy link
Owner

@styfle

great timing, I am in the process of writing the code base in typescript. I'll let you know when I have a branch so you can review it.

@corbinu
Copy link
Author

corbinu commented Dec 27, 2018

@lorenzofox3 Are you still rewriting in TypeScript? I was thinking about taking a stab at writing a version in Rust that would compile to WASM+TypeScript as kinda a test project.

Corbin

@lorenzofox3
Copy link
Owner

yes sorry. I started again this vacations: v3 is being written in typescript

@corbinu
Copy link
Author

corbinu commented Dec 27, 2018

no need to be sorry at all! we all get busy thanks for your hard work!

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