GithubHelp home page GithubHelp logo

Set up Unit testing about navi HOT 4 CLOSED

thedevpath avatar thedevpath commented on August 22, 2024
Set up Unit testing

from navi.

Comments (4)

tophergates avatar tophergates commented on August 22, 2024

Personally, I do not have much experience with testing suites. If anyone has more experience with this, what are your thoughts/suggestions on a which testing library to use? I assume we'll need separate testing suites for server vs. client side...

from navi.

CodeDraken avatar CodeDraken commented on August 22, 2024

@tophergates

Well, I don't know about Preact, ( maybe enzyme works with it? ) but on the server Mocha, Expect, Supertest, and Superagent is nice and easy to setup. ( I haven't actually contributed yet just throwing some ideas out there )

yarn add --dev mocha expect supertest superagent

// index.test.js
const expect = require('expect')

it('test runner should work', () => {
  expect(5 + 5).toBe(10)
  expect(false).toBeFalsy()
  expect(null).toBeNull()
})

https://mochajs.org/
http://facebook.github.io/jest/docs/en/expect.html
https://github.com/visionmedia/supertest

I'll make a PR in case you guys want to go that route 😄

from navi.

motosharpley avatar motosharpley commented on August 22, 2024

Ya I have written tests in ruby mostly. For javascript the only thing I've used is mocha and chai and not extensively by any means. I will have to look but I think I might have a sandbox project I was messing with a while back to get familiar with mocha/chai. They seem to be common or jest would be another option to consider.

from navi.

motosharpley avatar motosharpley commented on August 22, 2024

so here's chai for preact https://github.com/developit/preact-jsx-chai/

from navi.

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.