Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
console.log("hello world");
console.log("nice to meet you!!");
console.log("hello world");
console.log("nice to meet you!!");
console.log("hello world");
console.log("nice to meet you!!");
14 changes: 14 additions & 0 deletions test/app.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Import a testing framework (e.g. Mocha, Jest, etc.)
const assert = require('assert');
const { execSync } = require('child_process');

// Write a test suite for app.ts
describe('app.ts', function() {
// Write a test case that checks that app.ts prints "hello world" and "nice to meet you!!" to the console
it('should print hello world and nice to meet you!!', function() {
// Run app.ts and capture the output
const output = execSync('node app.ts').toString();
// Assert that the output matches the expected strings
assert.match(output, /hello world\nnice to meet you!!\n/);
});
});