deno.land / std@0.166.0 / node / upstream_modules_test.ts

upstream_modules_test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.import { createRequire } from "./module.ts";import { assertEquals } from "../testing/asserts.ts";
const require = createRequire(import.meta.url);
Deno.test("get-caller-file works", () => { const getCallerFile = require("get-caller-file"); // The caller is foo. foo belongs to this file. // So the getCallerFile() returns the filename of this file function foo() { return getCallerFile(); } assertEquals(foo(), import.meta.url.replace(/^file:\/\//, ""));});
std
Deno standard library
GitHub Repositorydenoland/deno_std
GitHub Stars
2447

Version Info

Tagged at
2 months ago