Gathering detailed insights and metrics for aft-vitest-reporter
Gathering detailed insights and metrics for aft-vitest-reporter
Gathering detailed insights and metrics for aft-vitest-reporter
Gathering detailed insights and metrics for aft-vitest-reporter
Automated Functional Testing (AFT) packages supporting nodejs based Functional Testing
npm install aft-vitest-reporter
Typescript
Module System
Node Version
NPM Version
TypeScript (96.95%)
HTML (2.78%)
JavaScript (0.27%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
52 Commits
1 Watchers
6 Branches
1 Contributors
Updated on May 24, 2024
Latest Version
12.1.1
Package Id
aft-vitest-reporter@12.1.1
Unpacked Size
120.36 kB
Size
30.18 kB
File Count
33
NPM Version
lerna/7.4.2/node@v18.20.2+x64 (linux)
Node Version
18.20.2
Published on
May 23, 2024
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
a Vitest Reporter
integration for AFT providing support for AFT plugins, configuration and helpers
> npm i aft-vitest-reporter
using this Reporter
requires either calling the vitest
command with the following argument --reporter=aft-vitest-reporter
or from within a vitest.config.mjs
file like the following:
1// vitest.config.mjs 2import { defineConfig, configDefaults } from 'vitest/config'; 3 4export default defineConfig({ 5 ...configDefaults, 6 test: { 7 reporters: ['default', './node_modules/aft-vitest-reporter/dist/src/aft-vitest-reporter.js'], 8 environment: 'node', 9 } 10});
this package comes with two helper classes that can be utilised from within your Vitest specs to make use of AFT features.
AftVitestTest
the AftVitestTest
class extends from the AftTest
class providing the ability to parse the Spec name for any referenced Test. each Test ID must be surrounded with square brackets [ABC123]
. you can then either directly call the AftVitestTest.shouldRun()
async function which will determine if your test should be run based on any AFT PolicyPlugin
instances referenced in your aftconfig.json
file or you can call aftVitestTest(this, testFunction)
which will perform the AftVitestTest.shouldRun()
call and mark the test as skipped if it should not be run. using the AftVitestTest
class would look like the following:
!!WARNING!! using arrow functions in your Spec definition IS NOT SUPPORTED if using
AftVitestTest
because it removes thethis
scope
1describe('YourTestSuite', () => { 2 // use `aftVitestTest` to report results 3 it('can check if test [C1234] should be run', async function() { 4 await aftVitestTest(this, async (v: AftVitestTest) => { 5 // calls `v.test.skip()` if should not be run 6 await v.reporter.error('we should never get here if C1234 should not be run'); 7 const result = await doStuff(); 8 await t.verify(result, equaling('expected')); 9 }); // handles submitting the result to any AFT Reporter Plugins 10 }); 11 12 // use `AftVitestReporter` to report results 13 it('can check if test [C2345] should be run', async function() { 14 const aft = new AftVitestTest(this); 15 const shouldRun = await aft.shouldRun(); 16 if (shouldRun.result !== true) { 17 await aft.pending(shouldRun.message); // marks test as skipped 18 } 19 const result = await doStuff(); 20 expect(result).to.equal('expected'); // AftVitestReporter handles submitting the result to any AFT Reporter Plugins 21 }); 22});
which would output the following to your console and any AFT ReportingPlugin
instances referenced in your aftconfig.json
if the test ID should not be run:
117:52:45 - [YourTestSuite can check if test [C1234] should be run] - WARN - none of the supplied tests should be run: [C1234] 217:52:45 - [YourTestSuite can check if test [C1234] should be run] - WARN - test skipped
AftVitestTest
constructors expects to be passed a valid scope
containing reference to the currently executing Vitest.Test
. typically this will be an object passed in to your test
or it
function within your SpecReporter
works in both parallel and sequential execution modes, but you MUST ALWAYS pass a context to your it
or test
function if you are using AftVitestTest
class within your Specaft-vitest-reporter
Vitest Reporter can be used when testing with an environment of node
or jsdom
or any of the supported Vitest environment config values, but the AftVitestTest
class and aftVitestTest
function can only be used with your environment set to node
via your vitest.config.mjs
fileNo vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
28 existing vulnerabilities detected
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