Coder Social home page Coder Social logo

Comments (5)

nadeesha avatar nadeesha commented on September 15, 2024 1

My apologies. Since 0.2.0, we've introduced a ~ character in front of the engine name.

So, the correct format of the test should be:

// @t "can sum" sum(1, 2) ~equals 3

This is my mistake as I've overlooked to update certain parts of the docs and the demo. But I've made the updates with #18

If you change the format of the tests, it should work with the latest version. I'll try to have some kind of a warning for tests written in the deprecated method. Thanks for reporting this @FrontMage. Let me know if I can a bit more on this.

from saul.

nadeesha avatar nadeesha commented on September 15, 2024

@FrontMage can you paste the content of your .saulrc file please?

And one of your // @t annotations as well.

from saul.

FrontMage avatar FrontMage commented on September 15, 2024

package.json

{
  "name": "Neon",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "test": "nyc mocha node_modules/.bin/saul"
  },
  "dependencies": {
    "mocha": "^3.4.1",
    "nyc": "^10.3.2",
    "saul": "^0.2.4"
  },
  "nyc": {
    "include": [
      "webapps/**/*.js"
    ]
  }
}

.saulrc

{
    "fileGlob": "webapps/**/*.js",
    "customEnginesDir": "./src/custom-saul-engines"
}

test.js in webapps/controllers/test.js

// @t "can sum" sum(1, 2) equals 3
// @t "can handle zeroes" sum(0, 0) equals 0
exports.sum = function sum(a, b) {
  return a + b;
};

By the way, I found it working using "saul": "0.0.17",@nadeesha

from saul.

nadeesha avatar nadeesha commented on September 15, 2024

Thanks @FrontMage!

I don't see anything wrong with this. If you're not using any custom engines, you don't need custom-saul-engines key in .saulrc.

I've just released v0.2.4. Can you upgrade to that and check whether the problem is fixed?

from saul.

FrontMage avatar FrontMage commented on September 15, 2024

Removed custom-saul-engines, upgrade to v0.2.4 outputs these:

➜ npm test

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



  0 passing (1ms)

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

It seems not finding my test files.@nadeesha


When using 0.0.17, nothing else changed, it somehow works fine.

➜ npm test

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



  sum
    ✓ "can sum"
    ✓ "can handle zeroes"

  toJsonErr
    ✓ "can convert code, err, field to JSON str"
    ✓ "can convert without field"

  get_request_ip
    ✓ "can return pure ip str"
    ✓ "can return ip starts with ::ffff:"
    ✓ "can return ip in X-Forwarded-For headers"
    ✓ "can return ip in x-forwarded-for headers"
    ✓ "return null if input is a invalid"

  isEmpty
    ✓ "can judge if an array is empty"
    ✓ "can judge if an array is not empty"
    ✓ "can judge if an object is empty"
    ✓ "can judge if an object is not empty"
    ✓ "can handle none array, object input"

  toArr
    ✓ "can convert str to array"
    ✓ "throw error when encounter none str input"

  standardGender
    ✓ "can convert HashKey gender to standard gender"
    ✓ "throw error when input is not an array"

  generateRecommendHashKey
    ✓ "return HashKey str by product, gender"
    ✓ "return HashKey str by product, gender"
    ✓ "return null if input product is not one of [neon, meetstar]"

  toTitleCase
    ✓ "return title str mapped from input product str, when product is not a false value"
    ✓ "return title str mapped from input product str, when product is not a false value"
    ✓ "return title str mapped from input product str, when product is not a false value"
    ✓ "can handle upper cased str"
    ✓ "return 'Supe' when product is a false value"


  26 passing (20ms)

-------------|----------|----------|----------|----------|----------------|
File         |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-------------|----------|----------|----------|----------|----------------|
All files    |      100 |    87.88 |      100 |      100 |                |
 controllers |      100 |      100 |      100 |      100 |                |
  test.js    |      100 |      100 |      100 |      100 |                |
 utils       |      100 |    87.88 |      100 |      100 |                |
  utils.js   |      100 |    87.88 |      100 |      100 |          19,24 |
-------------|----------|----------|----------|----------|----------------|

from saul.

Related Issues (4)

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.