• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import '../common/index.mjs';
2import assert from 'assert';
3
4assert.strictEqual(Object.getPrototypeOf(import.meta), null);
5
6const keys = ['url'];
7assert.deepStrictEqual(Reflect.ownKeys(import.meta), keys);
8
9const descriptors = Object.getOwnPropertyDescriptors(import.meta);
10for (const descriptor of Object.values(descriptors)) {
11  delete descriptor.value; // Values are verified below.
12  assert.deepStrictEqual(descriptor, {
13    enumerable: true,
14    writable: true,
15    configurable: true
16  });
17}
18
19const urlReg = /^file:\/\/\/.*\/test\/es-module\/test-esm-import-meta\.mjs$/;
20assert(import.meta.url.match(urlReg));
21