
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@archikoder/architest
Advanced tools
This is the official implementation of ArchiTest principle for Typescript.
Using npm
npm install -D @archikoder/architest
For the sake of simplicity, the decorator "test" is the only thing that you have to import.
import { test } from '@archikoder/architest';
And in your "package.json" file, add the script
{
"scpipts": {
"test": "architest",
}
}
Now you can launch test with
npm run test
As @0x5afe manifest for ArchiTest (https://twitter.com/0x5afe/status/1754931820913729668), here are the principles that you need to assimiliate before writing your tests:
Suppose we have the class "Converter" defined below and we want to test its behavioural "convert" method.
// file Converter.ts
import { test } from "@archikoder/architest";
export class Converter {
protected rate: number;
constructor(rate: number) {
this.rate = rate;
}
public convert(amount: number): number {
return amount * this.rate;
}
}
We want to make sure that if the rate is "5", "convert(7)" should give us the number "35"
Here is a test class using Archikoder (You can place your test files wherever you want, we suggest to place it in the same file as the class you test)
// file Converter.ts
...
export class MyFirstTest extends Converter {
protected rate: number = 5;
@test
public convert(amount: number = 7): number {
return 35;
}
}
That's it!
This section is left blank.
ArchiTest's main target is to be the simplest test framework possible. Each item that would be in this section will be considered a failure.
To run tests in watch mode and rerun tests for every changes in code, add the option "--watch" in your script
{
"scpipts": {
"test": "architest --watch",
}
}
Tor run specific tests, add as argument a string from your test name
# run all test methods in the class "MyFirstTest"
npm run test MyFirstTest
# run only the test for method "Convert" in test class "MyFirstTest"
npm run test "MyFirstTest -> Convert"
# run only tests for classes ending with "est" and methods starting with "Con"
npm run test "est -> Con"
# run only tests for methods name starting with "Convert"
npm run test "-> Convert"
Architest can work without configuration: using the project root folder as tests root.
You can customize the configuration in your tsconfig file.
{
//...
"architest": {
"root": "./tests"
}
}
Contribution will soon be welcome after we validate world interest for ArchiTest.
FAQs
ArchiTest implementation for typescript
We found that @archikoder/architest 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.