Files
NapCatQQ/.pnpm-store/v3/files/df/9087ea7547c7866bddc3e46c459ecb8b7e2c24b8e31ae4d20e14544447fc1fe9953fc0bc473edd73e4c9372d39e64b9f0fca2b40de2eafa4ef6bb8d13fff43
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

32 lines
1.4 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var get_experimental_parser_plugins_1 = require("../get-experimental-parser-plugins");
test('it should return empty list', function () {
expect((0, get_experimental_parser_plugins_1.getExperimentalParserPlugins)([])).toEqual([]);
});
test('it should return flow and decorators', function () {
expect((0, get_experimental_parser_plugins_1.getExperimentalParserPlugins)(['flow', 'decorators'])).toEqual([
'flow',
'decorators',
]);
});
test('it should return decorators with parsed options', function () {
expect((0, get_experimental_parser_plugins_1.getExperimentalParserPlugins)([
'["decorators", { "decoratorsBeforeExport": true }]',
])).toEqual([['decorators', { decoratorsBeforeExport: true }]]);
});
test('it should return decorators with parsed options', function () {
expect((0, get_experimental_parser_plugins_1.getExperimentalParserPlugins)([
'flow',
'["decorators", { "decoratorsBeforeExport": true }]',
])).toEqual(['flow', ['decorators', { decoratorsBeforeExport: true }]]);
});
test('it should throw an Error for invalid JSON', function () {
expect(function () {
return (0, get_experimental_parser_plugins_1.getExperimentalParserPlugins)([
'flow',
'["decorators", { decoratorsBeforeExport: true }]',
]);
}).toThrowError('Invalid JSON in importOrderParserPlugins: ');
});