1.0.2 • Published 6 years ago

@gnarwall19/nymeria v1.0.2

Weekly downloads
3
License
MIT
Repository
-
Last release
6 years ago

:wolf: Nymeria

A small but functional JavaScript testing framework

Built with lots of help from Alcides Queiroz's guide on Medium

This framework was put together in order to help me better understand how testing wokrs in JavaScript. I Do NOT recommend ANYBODY use Nymeria for testing prodcution code!!

Now since that's out of the way, how do you use Nymeria to test your code?? Well as of now it's a long and complicated process, BUT... Like this:

npm i @gnarwall19/nymeria

  1. Create your own tests folder in your applications source folder
  2. In your tests folder, create an index.js file that:
    • has a variable called nymeria that requires '@gnarwall19/nymeria'
    • Requires your whatever.test.js files
    • Finishes with nymeria.end() to run the exit code
  3. Write all the tests you want in your .test.js files just make sure you require them in index.js!
  4. Run node tests from your projects source in the terminal/command prompt

CONSIDER THIS:

  • Make sure your tests folder has an index.js file that:
    1. Requires nymeria as a const
    2. Requires your whatever.test.js files
    3. Finishes with nymeria.end() to run the exit code
  • Whatever.test.js files need to require { guarantee, check, xcheck, group } as a const from nymeria
  • Check out the playground folder on github for some examples!

Example tests/index.js file

const nymeria = require('@gnarwall19/nymeria');

require('./cool-stuff.test');
require('./check-it-out.test');
require('./bad-naming-conventions.test');
require('./and-so-on.test');

nymeria.end();

Again, credit for this project must be given to Alcides Queiroz for putting together an awesome tutorial! read the medium article here