Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Test framework to run JavaScript (client) tests. Currently supports Chrome and Firefox (IE limitation due to lack of Promises support).
The main idea behind JustTest is having the client tests available within the development process (call it TDD, if you'd like to). The framework and the tests files are to be added directly to the webapp page. Each reload/refresh of the page will run the tests.
JustTest originally developed as a small'n'smart test framework for a personal needs (datatier-js), but I've decided to refactor it a bit and publish to the community as something useful, to my mind. Please feel free to comment, request, contribute.
Attention: the doc below is still in construction, more updates and detailed one will be published very soon!!! Meanwhile, the best way to actually see how the library should be used is it look onto its own tests in
tests
folder, and for CI/CD case -travis.yml
is a good start.
Work process:
a) Write your app functionality (API),
b) Write test that uses/hits that functionality,
c) See the tests you've added within the browser.
d) After finishing the active development phase tests invocation must obviously be removed from the sources, but you may want to keep them aside for an automation and/or regressions testing. Just rename your .html file with the tests before removing references to them.
Advantages:
a) You're immediatelly experiment with the functional aspect of an app actually using your APIs/logic,
b) The implementation is being tested immediatelly as well,
c) Tests, if left intact, are becoming regression tests on later stage,
d) Running the tests while running the application brings them closer to reality,
e) The dev process becomes more efficient: no need to setup test env (unless automation used), no need to invest in separate process of running tests: running app is running the tests as well.
Disadvantages:
a) References to tests and the framework mixed inside the production code (future feature of configuration by config.js will lower this to one reference only)
b) No reports persisted (two features are planned to handle this: (i) API to post the results to the specified URL [formats of XML_JUnit, XML_TestNG, XML_NUnit as well as JSON_JustTest, XML_JustTest are meant to be provided out of the box, as well as API to register custom format])
c) Currently tests files must be explicitly specified (either in .html or in config.js) which becomes inconvenient with dozens of files. There probably will be a server-side part supplied in a (distant :)) future to provider fully functioning test execution with Selenium-like approach.
The project under development right now. TODO list:
Typical usage of the JustTest would involve two steps:
(A) referring to the freamework and the tests in your html page;
(B) writing the actual test logic using an API (look example below and APIs).
index.html
<body>
...
<script src="just-test.js"></script>
<script src="test1.js"></script>
<script src="test2.js"></script>
</body>
test1.js
(function() {
'use strict';
var JT = window.Utils.JustTest, suite;
suite = JT.createSuite({ name: 'Suite object APIs' });
suite.addTest({ // options list described in API section below
name: 'JustTest namespace created okay'
}, function (pass, fail) {
if ('your internal validation logic fails') fail(new Error('error notice'));
if ('another fail') throw new Error('calling "fail" and throwing have the same effect');
pass();
});
suite.run();
})();
test2.js
(function() {
'use strict';
var JT = window.Utils.JustTest, suite;
suite = JT.createSuite();
suite.addTest(function (pass, fail) { // can skip the options, defaults will be used
...
});
suite.run();
})();
Framework object (default window.Utils.JustTest
):
Test (JustTest.Test
):
Suite (JustTest.Suite
):
FAQs
JavaScript tests runner
The npm package just-test receives a total of 7 weekly downloads. As such, just-test popularity was classified as not popular.
We found that just-test demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.