Software Alternatives, Accelerators & Startups

Creating a Chai like assertion library using proxies

Sinon.JS Mochajs Chai
  1. Standalone test spies, stubs and mocks for JavaScript.
    Pricing:
    • Open Source
    Assertions on mock functions (compatible with sinonjs and tinyspy).

    #Developer Tools #Testing #Debugging 24 social mentions

  2. Mocha is a JavaScript test framework running on Node.js and the browser, making asynchronous testing simple.
    Pricing:
    • Open Source
    While this is fine and I could have perfectly moved all my tests to use said assertion style, I like the descriptive way Jest tests look like. As a quick way to maintain certain similarity I reached for ChaiJS, an assertion library that is mainly used with mocha. Chai offers expect like assertions that can arguably be more descriptive than Jestโ€™s. Instead of writing expect(โ€ฆ).toBe(true), youโ€™d write expect(โ€ฆ).to.be.true. For the most part I managed to do a search and replace for this.

    #Development Tools #Javascript UI Libraries #JavaScript Framework 104 social mentions

  3. 3
    Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework.
    While this is fine and I could have perfectly moved all my tests to use said assertion style, I like the descriptive way Jest tests look like. As a quick way to maintain certain similarity I reached for ChaiJS, an assertion library that is mainly used with mocha. Chai offers expect like assertions that can arguably be more descriptive than Jestโ€™s. Instead of writing expect(โ€ฆ).toBe(true), youโ€™d write expect(โ€ฆ).to.be.true. For the most part I managed to do a search and replace for this.

    #Developer Tools #Testing #Debugging 4 social mentions

Discuss: Creating a Chai like assertion library using proxies

Log in or Post with