You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After I implemented my modules, I also added assert.js and test.js, according to CommonJS/Unit Testing/1.0.
It provides a number of assert functions, such as assert(), assert.equal(), assert.deepEqual() and assert.throws(). These can be used to prevent some errors.
Then there is test.js that contains only one function: run(). You provide an object with functions starting with the letters 'test' and it will execute all these. Very nice for making unit tests. In a module, you run the code:
This means that you can include unit tests in your module, and run those tests if your module become the main module. This is how CommonJS describes it.
I think it is a neat little addition that does not cause trouble when added to pegasus but it will advertize good programming style.
The text was updated successfully, but these errors were encountered:
After I implemented my modules, I also added assert.js and test.js, according to CommonJS/Unit Testing/1.0.
It provides a number of assert functions, such as assert(), assert.equal(), assert.deepEqual() and assert.throws(). These can be used to prevent some errors.
Then there is test.js that contains only one function: run(). You provide an object with functions starting with the letters 'test' and it will execute all these. Very nice for making unit tests. In a module, you run the code:
This means that you can include unit tests in your module, and run those tests if your module become the main module. This is how CommonJS describes it.
I think it is a neat little addition that does not cause trouble when added to pegasus but it will advertize good programming style.
The text was updated successfully, but these errors were encountered: