
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ts-arch-test
Advanced tools
test architecture dependencies
kinda in a stable state now, I'm using it myself and it's been useful!
npm install --save-dev ts-arch-test
npm install --save-dev ts-arch-test@latest
import {verifyArchitecture} from 'ts-arch-test';
import {expect} from 'chai';
describe('Architecture test', () => {
it('single case', async () => {
expect(await verifyArchitecture({
filesFromFolder: 'testdata/tsconfig-inheritance/src/lib/db',
notDependOnFolder: 'testdata/tsconfig-inheritance/src/lib/services'
}, 'tsconfig.json')).to.deep.equal([]);
})
});
import { verifyArchitecture, clickableErrorMessage } from 'ts-arch-test';
import {expect} from 'chai';
describe('Architecture test', () => {
it('single case', async () => {
const spec = {
filesFromFolder: 'testdata/tsconfig-inheritance/src/lib/db',
notDependOnFolder: 'testdata/tsconfig-inheritance/src/lib/services'
};
const violations = await verifyArchitecture(spec, 'tsconfig.json');
const msg = clickableErrorMessage(spec, violations);
expect(violations, msg).toEqual([]);
})
});
import { describe, expect, it } from 'vitest';
import { verifyArchitecture } from 'ts-arch-test';
describe('Architecture test', () => {
const folders: Record<string, string> = {
db: 'src/lib/server/db',
repositories: 'src/lib/server/repositories',
services: 'src/lib/server/services',
routes: 'src/routes'
};
const cases = [
{ filesFromFolderKey: 'db', notDependOnFolderKeys: ['repositories', 'services', 'routes'] },
{ filesFromFolderKey: 'repositories', notDependOnFolderKeys: ['services', 'routes'] },
// { filesFromFolderKey: 'services', notDependOnFolderKeys: ['db'] }, // todo: fix architecture
{ filesFromFolderKey: 'services', notDependOnFolderKeys: ['routes'] },
{ filesFromFolderKey: 'routes', notDependOnFolderKeys: ['db', 'repositories', 'routes'] }
];
cases.forEach(({ filesFromFolderKey, notDependOnFolderKeys }) => {
describe(filesFromFolderKey, () => {
notDependOnFolderKeys.forEach(notDependOnFolderKey => {
it(`${filesFromFolderKey} should not depend on ${notDependOnFolderKey}`, async () => {
expect(await verifyArchitecture({
filesFromFolder: folders[filesFromFolderKey],
notDependOnFolder: folders[notDependOnFolderKey]
}, 'tsconfig.json')).toEqual([]);
});
});
});
});
});
npm version patch && npm publish
FAQs
test architecture dependencies in typescript
We found that ts-arch-test demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.