Giter VIP home page Giter VIP logo

Comments (7)

bd82 avatar bd82 commented on May 28, 2024

I think there is perhaps a mixup of a couple different things here.

Karma is a test runner for JavaScript, but more precisely it runs tests in a browser.
So while a test harness is probably a good idea, going all the way to browser testing
is perhaps too far for an initial step.

@cdiggins If you are interested in some better testing tools have a look at some of the following.

I only have experience with Mocha and afaik it is the only one compatible with running tests
in browsers via a karma plugin, this is a major advantage as it enables running tests
on Cloud Based testing services (sauceLabs) on multiple browsers.

However, browser testing is a pain to setup and get working initially so I would not start with that 😄

Eva and Jest are newer testing frameworks which should have fancier features
(parallel testing, testing only code that could be affected for quick feedback, ...)
So if browser testing is less relevant perhaps start by checking out their features.

anyhow a more modern testing framework is recommended 😄
instead of writing your own test runner as they will provide
better reporting, code coverage tools, automatic running in the background, CLI tools
and more...

from myna-parser.

Sciumo avatar Sciumo commented on May 28, 2024

Christopher already has QUnit tests (https://github.com/cdiggins/myna-parser/blob/master/tests/qunit.html), refactoring for karma is a step towards command line test automation. I have started on automation and I'll provide a pull if I have further grammars I need testing.

from myna-parser.

cdiggins avatar cdiggins commented on May 28, 2024

I used to use Mocha to test on the command-line along with Instanbul to do code-coverage. At one point I thought it just complicated things, so I removed it. I could put it back.

from myna-parser.

cdiggins avatar cdiggins commented on May 28, 2024

I just re-added Mocha tests. This way we can run the same tests from both from the command-line or from QUnit.html. Hope this addresses this issue. Let me know if there is a good reason to prefer Karma to Mocha for Myna.

from myna-parser.

Sciumo avatar Sciumo commented on May 28, 2024

Mocha is great. I'm getting a tsc build error I'll have to check.
myna.ts(859,64): error TS2304: Cannot find name 'console'.

from myna-parser.

bd82 avatar bd82 commented on May 28, 2024

Let me know if there is a good reason to prefer Karma to Mocha for Myna.

These are not mutually exclusive, Karma can be used for running the mocha tests in
a browser it does not replace it.

from myna-parser.

cdiggins avatar cdiggins commented on May 28, 2024

@Sciumo if you install Myna using npm and run "npm test" does it work? It should not engage the TypeScript compiler.

from myna-parser.

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.