Gathering detailed insights and metrics for leyati
Gathering detailed insights and metrics for leyati
Gathering detailed insights and metrics for leyati
Gathering detailed insights and metrics for leyati
npm install leyati
Typescript
Module System
Min. Node Version
Node Version
NPM Version
32.4
Supply Chain
62
Quality
62.6
Maintenance
25
Vulnerability
90.7
License
JavaScript (91.34%)
Smarty (8.66%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
10 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Nov 27, 2022
Latest Version
1.0.2
Package Id
leyati@1.0.2
Size
38.12 kB
NPM Version
3.10.10
Node Version
6.10.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
20
Inspector Leyati runs unit tests from templates for a collection of React components and saves the successful and retained into a final unit test script.
The location and name of a component are placed into given template that is saved as an "alpha test script". The tests in this script are run and those passed are written to a final test script. Failed tests are not written to the final test script unless they have the annotation @leyati-retain
right above them.
Leyati uses babel, babylon, and Mocha.
npm install --save leyati
bin/leyati.js <command>
(commands: "init")
bin/leyati.js <template file name> <test script destination> <source location> [component name]
new Inspector(templateFilename, testsPath, componentName)
inspector.options(config)
The shape of config
is as follows and can be found in config.js:
{
createTestScriptEvenIfAllTestsFail: true,
leaveAlphaTestScript: false,
babelOptions: {...},
babylonOptions: {...},
mochaOptions: {...}
}
inspector.setConstant(name, value)
Set value
for a placeholder that is found in given template by name
.
inspector.on(eventType, fn)
Set callbacks for events. For now there is only one, "finalized", that is called after all tests in a script have been run and the final test script been written.
inspector.processTemplate()
Replaces placeholders in given template file with the given constants.
inspector.saveAlphaTestScript()
Saves the source code processed in processTemplate()
as an alpha test script.
inspector.runTests()
Runs the tests in an alpha test script and saves the successful and retained into a final unit test script.
inspector.run()
Calls processTemplate()
, saveAlphaTestScript()
, and runTests()
.
A singleton that provides all available Leyati annotations and a RegExp pattern for them.
const Inspector = require("leyati").Inspector;
const inspector = new Inspector("tpl/essential.js.tpl", "tests", "Foo");
inspector.options({...});
inspector.setConstant("%COMPONENT_NAME%", "Foo");
inspector.setConstant("%COMPONENT_PATH%", "src/Foo.js");
inspector.run();
The placeholder format in the templates bundled with Leyati is "%PLACEHOLDER_NAME%", but Leyati accepts any format.
Leyati/Inspector uses eshal to find out the names of exported components in an ES6 file so naming testable components is not necessary on the command line.
Writes alpha and final test scripts. By default, an alpha test script is removed after a final test script is written.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/10 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More