
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Combined test dependencies for APC projects
This package provides a skeleton for JS unit testing, coverage and mutation testing. The provided config assumes files to be tested match src/**/*.js
and test specs match test/**/*.spec.js
but it should be straight forward to add more globs to your config.
npm install --save-dev apc-test
Copy these scripts into your package.json
file. They are used by the build in Travis (see below)
"test": "npm run lint && nyc mocha",
"lint": "eslint *.js test/**/*.js src/**/*.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"stryker": "stryker run"
Copy the following into your gitignore:
# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Dependency directories
node_modules/
# Optional npm cache directory
.npm
# Stryker reports and cache
.stryker-tmp
reports
Copy the following into a .nycrc
file:
{
"include": [ "src/**/*.js" ],
"all": true,
"watermarks": {
"lines": [ 90, 99 ],
"functions": [ 90, 99 ],
"branches": [ 90, 99 ],
"statements": [ 90, 99 ]
},
"reporter": [ "clover", "text", "text-summary", "html", "cobertura", "lcov" ],
"cache": true
}
Or copy it cp node_modules/apc-test/.nycrc .
Add the following to a stryker.conf.js
file:
module.exports = config => {
config.set({
files: [
{
pattern: 'src/**/*.js',
mutated: true,
included: true
},
'test/**/*.js'
],
testRunner: 'mocha',
mutator: 'javascript',
transpilers: [],
reporter: ['html', 'clear-text', 'progress'],
testFramework: 'mocha',
coverageAnalysis: 'perTest'
})
}
Or copy it cp node_modules/apc-test/.stryker.conf.js .
Add the following to a .travis.yml
file:
language: node_js
node_js:
- 'lts/*'
- 'node'
after_script:
# Optionally run stryker in CI, although this currently isn't reported
# - npm run stryker
- npm run coverage
Or copy it cp node_modules/apc-test/.travis.yml .
Add the badge images and links to the top of your markdown file:
[![NPM Package][npm-badge]][npm-link] [![License][license-badge]][license-link] [![Build Status][travis-badge]][travis-link] [![Coverage Status][coveralls-badge]][coveralls-link] [![Maintainability][cc-badge]][cc-link] [![Dependencies][dm-badge]][dm-link] [![Dev Dependencies][dmdev-badge]][dmdev-link] [![Greenkeeper badge][gk-badge]][gk-link]
Add the links somewhere else in your markdown file. Replacing my-org-name
and my-module-name
.
[npm-badge]: https://img.shields.io/npm/v/my-module-name.svg?maxAge=30
[npm-link]:https://npmjs.com/package/my-module-name
[license-badge]: https://img.shields.io/npm/l/my-module-name.svg
[license-link]: https://github/my-org-name/my-module-name/blob/master/LICENSE
[travis-badge]: https://travis-ci.org/my-org-name/my-module-name.svg?branch=master
[travis-link]: https://travis-ci.org/my-org-name/my-module-name
[coveralls-badge]: https://coveralls.io/repos/github/my-org-name/my-module-name/badge.svg?branch=master
[coveralls-link]: https://coveralls.io/github/my-org-name/my-module-name?branch=master
[cc-badge]: https://img.shields.io/codeclimate/maintainability/my-org-name/my-module-name.svg
[cc-link]: https://codeclimate.com/github/my-org-name/my-module-name/maintainability
[dm-badge]: https://img.shields.io/david/my-org-name/my-module-name.svg
[dm-link]: https://david-dm.org/my-org-name/my-module-name
[dmdev-badge]: https://img.shields.io/david/dev/my-org-name/my-module-name.svg
[dmdev-link]: https://david-dm.org/my-org-name/my-module-name
[gk-badge]: https://badges.greenkeeper.io/my-org-name/my-module-name.svg
[gk-link]: https://greenkeeper.io/
These steps assume a public github repo and public npm module.
CC_TEST_REPORTER_ID
environment variablesRecommended to be used with apc-style for linting of JS, SCSS and Pug files.
FAQs
APC Test stack bundled into one package
The npm package apc-test receives a total of 7 weekly downloads. As such, apc-test popularity was classified as not popular.
We found that apc-test demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.