Skip to content

Commit

Permalink
test: namespace export should have @@toStringTag with correct propert…
Browse files Browse the repository at this point in the history
…y descriptors
  • Loading branch information
dnalborczyk committed Feb 2, 2022
1 parent 50f46bc commit e38cfca
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/function/samples/namespace-to-string-tag/_config.js
@@ -0,0 +1,8 @@
module.exports = {
description: 'namespace export should have @@toStringTag with correct property descriptors #4336',
options: {
output: {
namespaceToStringTag: true
}
}
};
1 change: 1 addition & 0 deletions test/function/samples/namespace-to-string-tag/foo.js
@@ -0,0 +1 @@
export const foo = 'bar';
11 changes: 11 additions & 0 deletions test/function/samples/namespace-to-string-tag/main.js
@@ -0,0 +1,11 @@
import * as ns from './foo.js';

const { configurable, enumerable, value, writable } = Object.getOwnPropertyDescriptor(
ns,
Symbol.toStringTag
);

assert.strictEqual(value, 'Module', 'value');
assert.strictEqual(configurable, false, 'configurable');
assert.strictEqual(enumerable, false, 'enumerable');
assert.strictEqual(writable, false, 'writable');

0 comments on commit e38cfca

Please sign in to comment.