Git Product home page Git Product logo

Comments (12)

ry avatar ry commented on April 28, 2024 15

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.

yoavmmn avatar yoavmmn commented on April 28, 2024 5

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.

kitsonk avatar kitsonk commented on April 28, 2024 3

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.

jsommr avatar jsommr commented on April 28, 2024

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.

robbym avatar robbym commented on April 28, 2024

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.

ry avatar ry commented on April 28, 2024

@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.

hayd avatar hayd commented on April 28, 2024

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.

bartlomieju avatar bartlomieju commented on April 28, 2024

@ry close in favor of testing module in standard library?

from deno.

hayd avatar hayd commented on April 28, 2024

Once import() is working I will add this to std testing similar to --fmt.

from deno.

ry avatar ry commented on April 28, 2024

This is still desired. @hayd looking forward to it.

from deno.

bartlomieju avatar bartlomieju commented on April 28, 2024

Resolved in #2783!

CC @ry

from deno.

ry avatar ry commented on April 28, 2024

Nice work :D

from deno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.