Skip to content

Commit 8680101

Browse files
authored
test: explanatory comments for import.meta.* tests (#739)
Signed-off-by: Miroslav Bajtoš <[email protected]>
1 parent 17c25e9 commit 8680101

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

runtime/tests/js/webapis_tests.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ test("Float16Array", () => {
5151
});
5252

5353
test("import.meta.filename", () => {
54+
// Test that `import.meta.filename` is provided by the runtime and contains the expected file path.
55+
// We don't know the absolute location of the file `runtime/tests/js/webapis_test.js`, therefore
56+
// we check only the suffix (the path relative to the repository root).
5457
const value = import.meta.filename.replaceAll("\\", "/");
5558
const expectedSuffix = "/runtime/tests/js/webapis_tests.js";
5659
assert(
@@ -60,6 +63,9 @@ test("import.meta.filename", () => {
6063
});
6164

6265
test("import.meta.dirname", () => {
66+
// Test that `import.meta.dirname` is provided by the runtime and contains the expected directory path.
67+
// We don't know the absolute location of the directory `runtime/tests/js`, therefore we check only the
68+
// suffix (the path relative to the repository root).
6369
const value = import.meta.dirname.replaceAll("\\", "/");
6470
const expectedSuffix = "/runtime/tests/js";
6571
assert(

0 commit comments

Comments
 (0)