Comments (3)
Hello.
To be honest I don't know: https://raw.githubusercontent.com/lorenzofox3/zora/master/src/reporter.ts exists, so it might be a bug in Deno's loader.
Maybe you can try by using this bundle file URL.
Perhaps @bdchauvette can help you. He is the only Deno's user I am aware of
from zora.
You have to use the bundle URL and you won't be able to use any TS interfaces because the declarations use node-style path imports. Here's a minimal example.
The reason you have to use the bundle is that it's pretty much impossible to write TS sources that are compatible with both Deno and tsc
. The issue is that Deno requires you to include .ts
in the import path but the tsc
itself does not allow you to import files ending with .ts
(see e.g. microsoft/TypeScript#37582). As a result, you can either write TS sources that work with Deno or TS sources that work with tsc
, but not both.
The reason the declarations don't work is again related to Deno's requirement that imports need to match the exact file name. The Zora typings are not bundled and they use Node-style extensionless paths. So even if you add a // @deno-types
annotation (see below), it will fail when trying to import the other type files:
// @deno-types="https://unpkg.com/[email protected]/dist/declarations/index.d.ts"
import { test } from 'https://unpkg.com/[email protected]/dist/bundle/module.js';
In my case, I'm writing a cross-runtime lib, so I'm writing the tests with Node-style imports, then bundling everything together (with some changes based on target runtime) into tmp files, then running Node, Deno, QuickJS, etc. against the temp files. The only runtime support that I was missing from Zora was the ability to read env vars from the Deno
object like it does with process
in Node (#73).
If you're only supporting Deno, you should probably use Deno's builtin test framework or something like Rhum that targets Deno exclusively.
@lorenzofox3 -- Sorry for adding some maintenance overhead here 😓
I'm actually probably going to end up writing my own testing framework (no issue with Zora, I just prefer Mocha/Jest bdd-style structure for tests), so it might be simpler to revert #73 to avoid any confusion about Deno support 😬
from zora.
Thanks for your thorough feedback @bdchauvette 👍 I'll close this one for now
from zora.
Related Issues (20)
- Difference to Tape / AVA? HOT 1
- Add examples for Svelte, Vue and React HOT 1
- Structured comparison HOT 6
- Switching between character/line diff? HOT 1
- Assert type problems: can't extend assertion types in TypeScript
- Improve diff reporter HOT 6
- Bad type-declaration for `throws` HOT 1
- Pipe error handling (write EPIPE) HOT 2
- Inconsistent behaviour of tap reporters HOT 2
- Empty test.ts file in the node-ts example HOT 1
- build npm package HOT 3
- Zora + pta doesn't work with top level dynamic imports HOT 5
- Question: flow control across multiple files HOT 9
- Discussion: enable mix of cjs and es test code. HOT 5
- Example of cleaner ts-node setup with pta + TypeScript
- Zora pta doesn't report anything if there are any pending tests that don't wait for any events HOT 6
- Zora doesn't recognize differences bewteen Maps HOT 2
- The new timeout feature doesn't work correctly for serial tests (await) HOT 1
- pta reports PASS 0 before passing Zora tests finish running HOT 6
- How to know when all tests have completed? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zora.