-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Llorx/move-tests-to-self-framework
test: Move nodejs tests to self tests
- Loading branch information
Showing
20 changed files
with
1,914 additions
and
1,360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
import { test } from "node:test"; | ||
import * as PATH from "node:path"; | ||
import * as Assert from "node:assert"; | ||
import * as PATH from "path"; | ||
import * as Assert from "assert"; | ||
|
||
import { MainContext } from "./MainContext"; | ||
import test from "arrange-act-assert"; | ||
|
||
import { MainContext } from "./MainContext"; | ||
import { mockFiles } from "../test_folder_mock"; | ||
|
||
test.describe("MainContext", () => { | ||
test("Should receive all files", async () => { | ||
// Arrange | ||
const context = new MainContext(); | ||
const test_folder_mock = PATH.dirname(mockFiles["index"]); | ||
|
||
// Act | ||
const files = await context.getFiles(test_folder_mock); | ||
|
||
// Assert | ||
Assert.deepStrictEqual(files.sort(), Object.values(mockFiles).sort(), "Not received all files"); | ||
test.describe("MainContext", (test) => { | ||
test("Should receive all files", { | ||
ARRANGE() { | ||
const context = new MainContext(); | ||
const test_folder_mock = PATH.dirname(mockFiles["index"]); | ||
return { context, test_folder_mock }; | ||
}, | ||
async ACT({ context, test_folder_mock }) { | ||
return await context.getFiles(test_folder_mock); | ||
}, | ||
ASSERT(files) { | ||
Assert.deepStrictEqual(files.sort(), Object.values(mockFiles).sort()); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.