UNPKG

contract-shield-cli

Version:

A CLI tool that verifies preconditions, postconditions, and invariants in contracts without altering their original source code. `contract-shield-cli` enforces Design by Contract principles externally, ensuring contracts behave as expected while preservin

19 lines (16 loc) 611 B
const fs = require('fs'); const { execSync } = require('child_process'); describe('transpileCommand CLI', () => { beforeAll(() => { // Create a test config file before running the tests fs.writeFileSync('test-config.json', JSON.stringify({ option: true })); }); afterAll(() => { // Clean up the test config file after tests are done fs.unlinkSync('test-config.json'); }); test('CLI runs with a specified config file', () => { const output = execSync('node src/cli.js transpile --config test-config.json').toString(); expect(output).toBeDefined(); }); });