Coder Social home page Coder Social logo

saul's Issues

Usage with Jest

Hey, this looks really good, trying to use it with an exisiting project which uses Jest but am unsure how to make that work, or if it does atm.

In a file in ./src:

...
// @t "should add numbers" add(1, 2) equals 3
export const add = (a, b) => a + b
...

.saulrc:

{
    "fileGlob": "src/**/*.js"
}

scripts in package.json:

...
"test": "NODE_ENV=test jest --config jest.config.json --verbose node_modules/.bin/saul",
...

outcome:

❯ npm t

> [email protected] test /Users/kav/Sites/playground/sauling
> NODE_ENV=test jest --config jest.config.json --verbose node_modules/.bin/saul

No tests found
In /Users/kav/Sites/playground/sauling
  10 files checked.
  testMatch:  - 10 matches
  testPathIgnorePatterns: /node_modules/ - 10 matches
  testRegex: \.test\.js$ - 1 match
Pattern: "node_modules/.bin/saul" - 0 matches

so it seems the jest cli uses that last bit of the command to look for matching tests. Same thing happens if i take node_modules/.bin/saul out of the npm script and run npm t node_modules/.bin/saul. npm t | node_modules/.bin/saul hail mary is all errors:

/Users/kav/Sites/playground/sauling/node_modules/saul/lib/testcase.js:6
var suite = exports.suite = describe;
                            ^

ReferenceError: describe is not defined

Is anything in the Jest config that can be set up for it to work?

Thanks heaps!

test async functions

Hi, I've been using saul to test my code, it's really fantastic.
However when testing with asyn functions, I wrote an test engine like this:

const expect = require('chai').expect;

module.exports = (
  testDescription,
  func,
  argsArray,
  expected,
  test
) => {
  test(testDescription, () => {
    func.apply(null, argsArray)
      .then(actual => {
        expect(actual).to.eql(eval(`var trouble = ${expected}; trouble`));
      });
  });
};

It suppose to act like deep-equals with function returns promise, but it's not working and it did not throw any error.
Could you help me with this? Thanks :)

[RESOLVED] Current version not working

I've done as the readme says, but it does not test any file.

Results are like these:

[email protected] test /home/xinbg/Documents/pincloud.supe
nyc mocha src/**/*.test.js node_modules/.bin/saul

Warning: Could not find any test files matching pattern: src/**/*.test.js

0 passing (1ms)

----------|----------|----------|----------|----------|----------------|

File % Stmts % Branch % Funcs % Lines Uncovered Lines
All files Unknown Unknown Unknown Unknown
---------- ---------- ---------- ---------- ---------- ----------------

Also wondering how to exclude node_modules folder?

Describe is not defined

Hi,

When I want to start and watch the application for contributing, I receive an error with the following message:

var suite = exports.suite = describe; // eslint-disable-line no-undef

ReferenceError: describe is not defined

Would you please help me in solving this problem in development mode?

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.