Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
platelunch
Advanced tools
Platelunch generates boilerplate unit test code for javascript source files. Currently it will generate unit test files to be used with jest only. More testing frameworks will be supported.
npm install --save-dev platelunch
--- or globally
npm install -g platelunch
platelunch [opts] [filename ...]
Platelunch will create a directory __tests__
where all the generated unit test files will be created.
WARNING If a test file exists in __tests__
it will be overwritten unless the glob or filename does not include that file.
Using glob to find files to generate unit tests
platelunch --test-framework jest "src/**/*.js"
Only one unit test file will be generated
platelunch --test-framework jest "src/my-file.js"
function add(num1, num2) {
return num1 + num2;
}
module.exports = {
add: add
};
const add = require("src/my-module.js").add;
describe("my-module.js", () => {
test("add", () => {
const num1 = null;
const num2 = null;
const result = add(num1, num2);
});
});
function add(num1, num2) {
return num1 + num2;
}
export { add };
import { add } from "src/my-module.js"
describe("my-module.js", () => {
test("add", () => {
const num1 = null;
const num2 = null;
const result = add(num1, num2);
});
});
export class TestClass {
add(num1, num2) {
return num1 + num2;
}
};
import { TestClass } from "TestClass.js";
describe("TestClass.js", () => {
let testClass;
beforeEach(() => {
testClass = new TestClass();
});
test("add", () => {
const num1 = null;
const num2 = null;
const result = testClass.add(num1, num2);
});
});
The code in this project is licensed under MIT license.
FAQs
Generate boilerplate code for unit tests
The npm package platelunch receives a total of 5 weekly downloads. As such, platelunch popularity was classified as not popular.
We found that platelunch 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.