Comments (7)
@rquadling you'll probably be better served exploring other testing frameworks. nodeunit is not under very active development. There are other modern and very active projects. My personal favorite is https://github.com/tapjs/node-tap
from nodeunit.
Being completely new to JS unit testing, one thing I liked was how I could easily may the concepts of our PHPUnit testing (data providers, testcases, methods) to nodeunit. Very similar code layout.
Would you be able to "convert" one of our node unit tests to tap as an example? None of the team I'm with are expert enough yet, so we are learning from those that know more. https://gist.github.com/rquadling/457b5f4a7a3b01bd9df68e623bdc8fc5
from nodeunit.
I'm not going to convert an entire unit test, but here's a stripped down example to get you started:
'use strict'
const Calculator = require(__dirname + '/../Digitickets').Calculator
const tap = require('tap')
tap.test('basic calculator functionality', function(test) {
const calculator = new Calculator()
test.equals(calculator.getAmountTendered(), 0.00,
'Amount Tendered starts at 0.00 for ' + testName)
test.equals(calculator.getChange(), 0.00, 'Change Given starts at 0.00 for ' + testName)
// ... further tests follow...
test.end()
})
tap.test('some other calculator test', function(test) {
// TODO: assertions go here
test.end()
})
I'd recommend taking a look at http://www.node-tap.org/basics
I think you'll find these examples are pretty simple and you shouldn't have any trouble writing tap tests should you decide to do so.
from nodeunit.
nodeunit is not under very active development
@mreinstein This would go great in the README or project description.
from nodeunit.
This would go great in the README or project description.
@0joshuaolson1 I'd accept a PR for this
from nodeunit.
https://github.com/caolan/nodeunit/edit/master/README.md
from nodeunit.
send a proper pull request please
from nodeunit.
Related Issues (20)
- Some reporters do not display assertion error message HOT 4
- TAP reporter is broken in [email protected]+ (works in nodeunit 0.9.2) HOT 9
- issues with the _deepEqual algorithm HOT 2
- replace the old makefile with browserify or webpack
- Add explicit process exit on success HOT 1
- nodeunit.js in examples/browser is out of date HOT 1
- Incorrect exit code when running multiple directories HOT 2
- ReferenceError when using junit reporter in 0.11.0 HOT 4
- Q: Is there a better way to dynamically create tests than a monkey-patch? HOT 1
- Release 0.11.1 HOT 1
- FYI: nodeunit plugin for exhaustive testing of asynchronous sequences HOT 1
- setUp & tearDown not called as docs would imply
- Ways to skip, and run single(s) tests
- ES6 Module export
- Use template-literal instead of EJS
- Tap dependency update to v11 HOT 9
- make test on fresh clone failes due to undeclared dependencies HOT 1
- How to export function from module without nodeunit testing it?
- how to output html reporter to the file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodeunit.