Comments (12)
I think it’s better to have these thing prescribed - it’s very arbitrary and better if everyone just uses the same system
from deno.
I think it's good if everyone uses the same system, but we shouldn't force the use of the test*
pattern. Maybe it should be the default, but it will be better allowing custom patterns like deno test tests/*
.
from deno.
It also wouldn't preclude someone from running some other test harness or some other pattern, they simply wouldn't execute deno test
.
from deno.
Can't it be up to the community to create something that runs all files ending with _test.js? This seems a bit unnecessary...
from deno.
Attempting to implement this: robbym@d4b66fb
How does one get stuff, like all the function names in a file, from the C API?
Functionality not there yet?
from deno.
@robbym Yeah functionality is not there yet. Hold off on this for a bit... We've got one more sprint and then we'll be up and running on the prototype's runtime. It'll make more sense to talk about it once we've got that working.
from deno.
So, you can do this if the function is exported:
// foo_test.ts
export function testFoo() {
console.log("foo");
}
// test.ts
(async () => {
const name = "foo_test.ts";
const t = await import(name);
t.testFoo();
})();
Is there a way to access these if the function is not exported?
Edit: One possible solution is to support users grouping their test function in a class that's Test
prefixed e.g. TestFoo
. https://stackoverflow.com/a/32071275/1240268 :/
Edit2: I think there's a nice way to do this with the current test(...
api actually.
from deno.
@ry close in favor of testing module in standard library?
from deno.
Once import()
is working I will add this to std testing similar to --fmt.
from deno.
This is still desired. @hayd looking forward to it.
from deno.
Resolved in #2783!
CC @ry
from deno.
Nice work :D
from deno.
Related Issues (20)
- Cannot use async code in Jupyter notebooks with Deno kernel HOT 4
- `deno compile` cross compilation does not work Linux -> Windows HOT 5
- Implement napi_type_tag_object
- JSR entrypoints are not resolved when using standard import maps HOT 3
- LSP does not resolve `jsr:` specifiers pointing to a single workspace JSR package to itself HOT 1
- Import Data URL not working on Deno Deploy HOT 5
- suggestion: `deno publish --score` HOT 1
- `receiveMessageOnPort` not implemented in `node:worker_threads` HOT 1
- Deno panicked running `jsr-io/jsr` HOT 1
- lsp: slow types diagnostics quick fixes HOT 1
- bug: `thread 'main' panicked at cli\tools\test\channel.rs:219:53` in canary
- suggestion: option to only publish exported module graph
- `process.off` does not restore default SIGINT behaviour HOT 1
- Deno arm64 executable doesn't work.. HOT 1
- Add ARCHITECTURE.md
- `EventEmitterAsyncResource` required for `ng serve` (angular)
- Connection timed out when using Mongoose|MongoDB with deno cli HOT 1
- `docusaurus build` not working
- `npm:create-docusaurus` ReferenceError: require is not defined
- WebGPU: texture width and height are undefined when descriptor size is an array. 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 deno.