@featurevisor/core 3.0.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/datasource/datasource.d.ts +1 -1
- package/lib/datasource/datasource.js +4 -14
- package/lib/datasource/datasource.js.map +1 -1
- package/lib/datasource/requiredFeatures.d.ts +7 -0
- package/lib/datasource/requiredFeatures.js +38 -0
- package/lib/datasource/requiredFeatures.js.map +1 -0
- package/lib/linter/checkCircularDependency.d.ts +1 -1
- package/lib/linter/checkCircularDependency.js +3 -22
- package/lib/linter/checkCircularDependency.js.map +1 -1
- package/lib/linter/conditionSchema.js +27 -3
- package/lib/linter/conditionSchema.js.map +1 -1
- package/lib/tester/testFeature.js +17 -16
- package/lib/tester/testFeature.js.map +1 -1
- package/package.json +10 -7
- package/CHANGELOG.md +0 -2238
- package/coverage/clover.xml +0 -5456
- package/coverage/coverage-final.json +0 -64
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -371
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/src/assess-distribution/index.html +0 -116
- package/coverage/lcov-report/src/assess-distribution/index.ts.html +0 -754
- package/coverage/lcov-report/src/benchmark/index.html +0 -116
- package/coverage/lcov-report/src/benchmark/index.ts.html +0 -793
- package/coverage/lcov-report/src/builder/allocator.ts.html +0 -220
- package/coverage/lcov-report/src/builder/applyContextToConditions.ts.html +0 -502
- package/coverage/lcov-report/src/builder/applyContextToDatafile.ts.html +0 -772
- package/coverage/lcov-report/src/builder/applyContextToSegments.ts.html +0 -580
- package/coverage/lcov-report/src/builder/buildDatafile.ts.html +0 -2053
- package/coverage/lcov-report/src/builder/buildProject.ts.html +0 -1117
- package/coverage/lcov-report/src/builder/buildRuntimeDatafiles.ts.html +0 -256
- package/coverage/lcov-report/src/builder/getFeatureRanges.ts.html +0 -268
- package/coverage/lcov-report/src/builder/hashes.ts.html +0 -412
- package/coverage/lcov-report/src/builder/index.html +0 -311
- package/coverage/lcov-report/src/builder/index.ts.html +0 -91
- package/coverage/lcov-report/src/builder/mutateVariables.ts.html +0 -421
- package/coverage/lcov-report/src/builder/mutator.ts.html +0 -796
- package/coverage/lcov-report/src/builder/revision.ts.html +0 -151
- package/coverage/lcov-report/src/builder/traffic.ts.html +0 -661
- package/coverage/lcov-report/src/cli/cli.ts.html +0 -400
- package/coverage/lcov-report/src/cli/index.html +0 -131
- package/coverage/lcov-report/src/cli/plugins.ts.html +0 -214
- package/coverage/lcov-report/src/config/index.html +0 -131
- package/coverage/lcov-report/src/config/index.ts.html +0 -88
- package/coverage/lcov-report/src/config/projectConfig.ts.html +0 -925
- package/coverage/lcov-report/src/datasource/adapter.ts.html +0 -253
- package/coverage/lcov-report/src/datasource/datasource.ts.html +0 -1000
- package/coverage/lcov-report/src/datasource/filesystemAdapter.ts.html +0 -1576
- package/coverage/lcov-report/src/datasource/index.html +0 -161
- package/coverage/lcov-report/src/datasource/index.ts.html +0 -94
- package/coverage/lcov-report/src/evaluate/index.html +0 -116
- package/coverage/lcov-report/src/evaluate/index.ts.html +0 -814
- package/coverage/lcov-report/src/find-duplicate-segments/findDuplicateSegments.ts.html +0 -313
- package/coverage/lcov-report/src/find-duplicate-segments/index.html +0 -131
- package/coverage/lcov-report/src/find-duplicate-segments/index.ts.html +0 -307
- package/coverage/lcov-report/src/find-usage/index.html +0 -116
- package/coverage/lcov-report/src/find-usage/index.ts.html +0 -1780
- package/coverage/lcov-report/src/generate-code/index.html +0 -131
- package/coverage/lcov-report/src/generate-code/index.ts.html +0 -403
- package/coverage/lcov-report/src/generate-code/typescript.ts.html +0 -1909
- package/coverage/lcov-report/src/index.html +0 -131
- package/coverage/lcov-report/src/info/index.html +0 -116
- package/coverage/lcov-report/src/info/index.ts.html +0 -472
- package/coverage/lcov-report/src/init/index.html +0 -116
- package/coverage/lcov-report/src/init/index.ts.html +0 -280
- package/coverage/lcov-report/src/linter/attributeSchema.ts.html +0 -1963
- package/coverage/lcov-report/src/linter/checkCircularDependency.ts.html +0 -220
- package/coverage/lcov-report/src/linter/checkPercentageExceedingSlot.ts.html +0 -268
- package/coverage/lcov-report/src/linter/conditionSchema.ts.html +0 -2224
- package/coverage/lcov-report/src/linter/featureSchema.ts.html +0 -5851
- package/coverage/lcov-report/src/linter/groupSchema.ts.html +0 -226
- package/coverage/lcov-report/src/linter/index.html +0 -326
- package/coverage/lcov-report/src/linter/index.ts.html +0 -88
- package/coverage/lcov-report/src/linter/lintProject.ts.html +0 -2704
- package/coverage/lcov-report/src/linter/mutationNotation.ts.html +0 -1411
- package/coverage/lcov-report/src/linter/printError.ts.html +0 -289
- package/coverage/lcov-report/src/linter/schema.ts.html +0 -1558
- package/coverage/lcov-report/src/linter/segmentSchema.ts.html +0 -139
- package/coverage/lcov-report/src/linter/targetSchema.ts.html +0 -223
- package/coverage/lcov-report/src/linter/testSchema.ts.html +0 -529
- package/coverage/lcov-report/src/linter/zodHelpers.ts.html +0 -133
- package/coverage/lcov-report/src/list/index.html +0 -131
- package/coverage/lcov-report/src/list/index.ts.html +0 -2065
- package/coverage/lcov-report/src/list/matrix.ts.html +0 -721
- package/coverage/lcov-report/src/promoter/index.html +0 -116
- package/coverage/lcov-report/src/promoter/index.ts.html +0 -3883
- package/coverage/lcov-report/src/sets.ts.html +0 -313
- package/coverage/lcov-report/src/targeting.ts.html +0 -403
- package/coverage/lcov-report/src/tester/cliFormat.ts.html +0 -133
- package/coverage/lcov-report/src/tester/helpers.ts.html +0 -313
- package/coverage/lcov-report/src/tester/index.html +0 -206
- package/coverage/lcov-report/src/tester/prettyDuration.ts.html +0 -187
- package/coverage/lcov-report/src/tester/printTestResult.ts.html +0 -337
- package/coverage/lcov-report/src/tester/testFeature.ts.html +0 -1186
- package/coverage/lcov-report/src/tester/testProject.ts.html +0 -1018
- package/coverage/lcov-report/src/tester/testSegment.ts.html +0 -316
- package/coverage/lcov-report/src/utils/extractKeys.ts.html +0 -493
- package/coverage/lcov-report/src/utils/git.ts.html +0 -559
- package/coverage/lcov-report/src/utils/index.html +0 -161
- package/coverage/lcov-report/src/utils/index.ts.html +0 -94
- package/coverage/lcov-report/src/utils/pretty.ts.html +0 -121
- package/coverage/lcov.info +0 -11615
- package/jest.config.js +0 -22
- package/json-schema/README.md +0 -5
- package/json-schema/attribute.json +0 -40
- package/json-schema/feature.json +0 -394
- package/json-schema/segment.json +0 -137
- package/src/assess-distribution/index.ts +0 -223
- package/src/benchmark/index.ts +0 -236
- package/src/builder/allocator.spec.ts +0 -105
- package/src/builder/allocator.ts +0 -45
- package/src/builder/applyContextToConditions.spec.ts +0 -2677
- package/src/builder/applyContextToConditions.ts +0 -139
- package/src/builder/applyContextToDatafile.spec.ts +0 -2626
- package/src/builder/applyContextToDatafile.ts +0 -229
- package/src/builder/applyContextToSegments.spec.ts +0 -1593
- package/src/builder/applyContextToSegments.ts +0 -165
- package/src/builder/buildDatafile.spec.ts +0 -445
- package/src/builder/buildDatafile.ts +0 -656
- package/src/builder/buildProject.ts +0 -344
- package/src/builder/buildRuntimeDatafiles.ts +0 -57
- package/src/builder/getFeatureRanges.ts +0 -61
- package/src/builder/hashes.ts +0 -109
- package/src/builder/index.ts +0 -2
- package/src/builder/mutateVariables.spec.ts +0 -1179
- package/src/builder/mutateVariables.ts +0 -112
- package/src/builder/mutator.spec.ts +0 -413
- package/src/builder/mutator.ts +0 -237
- package/src/builder/revision.spec.ts +0 -22
- package/src/builder/revision.ts +0 -22
- package/src/builder/traffic.spec.ts +0 -946
- package/src/builder/traffic.ts +0 -192
- package/src/cli/cli.ts +0 -105
- package/src/cli/index.ts +0 -2
- package/src/cli/plugins.ts +0 -43
- package/src/config/index.ts +0 -1
- package/src/config/projectConfig.spec.ts +0 -194
- package/src/config/projectConfig.ts +0 -280
- package/src/datasource/adapter.ts +0 -56
- package/src/datasource/datasource.ts +0 -305
- package/src/datasource/filesystemAdapter.spec.ts +0 -212
- package/src/datasource/filesystemAdapter.ts +0 -497
- package/src/datasource/index.ts +0 -3
- package/src/dependencies.ts +0 -13
- package/src/evaluate/index.ts +0 -243
- package/src/find-duplicate-segments/findDuplicateSegments.ts +0 -76
- package/src/find-duplicate-segments/index.ts +0 -74
- package/src/find-usage/index.ts +0 -565
- package/src/generate-code/index.ts +0 -106
- package/src/generate-code/typescript.spec.ts +0 -214
- package/src/generate-code/typescript.ts +0 -608
- package/src/index.ts +0 -20
- package/src/info/index.ts +0 -129
- package/src/init/index.ts +0 -65
- package/src/linter/attributeSchema.spec.ts +0 -342
- package/src/linter/attributeSchema.ts +0 -626
- package/src/linter/checkCircularDependency.ts +0 -45
- package/src/linter/checkPercentageExceedingSlot.ts +0 -61
- package/src/linter/conditionSchema.spec.ts +0 -510
- package/src/linter/conditionSchema.ts +0 -713
- package/src/linter/featureSchema.spec.ts +0 -1985
- package/src/linter/featureSchema.ts +0 -1922
- package/src/linter/groupSchema.ts +0 -47
- package/src/linter/index.ts +0 -1
- package/src/linter/lintProject.spec.ts +0 -336
- package/src/linter/lintProject.ts +0 -873
- package/src/linter/mutationNotation.spec.ts +0 -704
- package/src/linter/mutationNotation.ts +0 -442
- package/src/linter/printError.ts +0 -68
- package/src/linter/schema.spec.ts +0 -690
- package/src/linter/schema.ts +0 -491
- package/src/linter/segmentSchema.spec.ts +0 -358
- package/src/linter/segmentSchema.ts +0 -18
- package/src/linter/targetSchema.spec.ts +0 -159
- package/src/linter/targetSchema.ts +0 -46
- package/src/linter/testSchema.spec.ts +0 -258
- package/src/linter/testSchema.ts +0 -148
- package/src/linter/zodHelpers.ts +0 -16
- package/src/list/index.spec.ts +0 -135
- package/src/list/index.ts +0 -660
- package/src/list/matrix.spec.ts +0 -49
- package/src/list/matrix.ts +0 -212
- package/src/promoter/index.spec.ts +0 -617
- package/src/promoter/index.ts +0 -1266
- package/src/sets.ts +0 -76
- package/src/targeting.spec.ts +0 -74
- package/src/targeting.ts +0 -106
- package/src/tester/cliFormat.ts +0 -16
- package/src/tester/helpers.spec.ts +0 -149
- package/src/tester/helpers.ts +0 -76
- package/src/tester/index.ts +0 -2
- package/src/tester/prettyDuration.ts +0 -34
- package/src/tester/printTestResult.ts +0 -84
- package/src/tester/testFeature.ts +0 -367
- package/src/tester/testProject.spec.ts +0 -50
- package/src/tester/testProject.ts +0 -311
- package/src/tester/testSegment.ts +0 -77
- package/src/utils/extractKeys.ts +0 -136
- package/src/utils/git.ts +0 -158
- package/src/utils/index.ts +0 -3
- package/src/utils/pretty.ts +0 -12
- package/tsconfig.cjs.json +0 -13
- package/tsconfig.typecheck.json +0 -9
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as os from "os";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
|
|
5
|
-
import { getProjectConfig } from "../config/projectConfig";
|
|
6
|
-
import { Datasource } from "../datasource";
|
|
7
|
-
import { generateTypeScriptCodeForProject } from "./typescript";
|
|
8
|
-
|
|
9
|
-
function createTempProjectFromExample1() {
|
|
10
|
-
const fixturePath = path.resolve(__dirname, "../../../../examples/example-1");
|
|
11
|
-
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), "featurevisor-codegen-"));
|
|
12
|
-
|
|
13
|
-
fs.cpSync(fixturePath, tempRoot, { recursive: true });
|
|
14
|
-
|
|
15
|
-
return tempRoot;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
describe("generate-code/typescript", () => {
|
|
19
|
-
let tempProjectPath: string;
|
|
20
|
-
let outputPath: string;
|
|
21
|
-
|
|
22
|
-
beforeEach(() => {
|
|
23
|
-
tempProjectPath = createTempProjectFromExample1();
|
|
24
|
-
outputPath = path.join(tempProjectPath, "generated");
|
|
25
|
-
fs.mkdirSync(outputPath, { recursive: true });
|
|
26
|
-
|
|
27
|
-
fs.writeFileSync(
|
|
28
|
-
path.join(tempProjectPath, "attributes", "account.yml"),
|
|
29
|
-
[
|
|
30
|
-
"description: Account",
|
|
31
|
-
"type: object",
|
|
32
|
-
"required:",
|
|
33
|
-
" - plan",
|
|
34
|
-
"properties:",
|
|
35
|
-
" plan:",
|
|
36
|
-
" type: string",
|
|
37
|
-
" enum:",
|
|
38
|
-
" - free",
|
|
39
|
-
" - pro",
|
|
40
|
-
" locale:",
|
|
41
|
-
" type: string",
|
|
42
|
-
].join("\n"),
|
|
43
|
-
"utf8",
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
fs.writeFileSync(
|
|
47
|
-
path.join(tempProjectPath, "attributes", "permissions.yml"),
|
|
48
|
-
[
|
|
49
|
-
"description: Permissions",
|
|
50
|
-
"type: array",
|
|
51
|
-
"items:",
|
|
52
|
-
" type: string",
|
|
53
|
-
" enum:",
|
|
54
|
-
" - read",
|
|
55
|
-
" - write",
|
|
56
|
-
" - admin",
|
|
57
|
-
].join("\n"),
|
|
58
|
-
"utf8",
|
|
59
|
-
);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
afterEach(() => {
|
|
63
|
-
fs.rmSync(tempProjectPath, { recursive: true, force: true });
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("generates schema-aware context types for attributes", async () => {
|
|
67
|
-
const projectConfig = getProjectConfig(tempProjectPath);
|
|
68
|
-
const datasource = new Datasource(projectConfig, tempProjectPath);
|
|
69
|
-
|
|
70
|
-
await generateTypeScriptCodeForProject(
|
|
71
|
-
{
|
|
72
|
-
rootDirectoryPath: tempProjectPath,
|
|
73
|
-
projectConfig,
|
|
74
|
-
datasource,
|
|
75
|
-
options: {},
|
|
76
|
-
} as any,
|
|
77
|
-
outputPath,
|
|
78
|
-
{},
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
const attributesContent = fs.readFileSync(path.join(outputPath, "attributes.ts"), "utf8");
|
|
82
|
-
const contextContent = fs.readFileSync(path.join(outputPath, "context.ts"), "utf8");
|
|
83
|
-
const featuresContent = fs.readFileSync(path.join(outputPath, "features.ts"), "utf8");
|
|
84
|
-
const functionsContent = fs.readFileSync(path.join(outputPath, "functions.ts"), "utf8");
|
|
85
|
-
const indexContent = fs.readFileSync(path.join(outputPath, "index.ts"), "utf8");
|
|
86
|
-
const generatedFiles = fs.readdirSync(outputPath).sort();
|
|
87
|
-
|
|
88
|
-
expect(attributesContent).toContain(
|
|
89
|
-
'export type AccountAttribute = { plan: "free" | "pro"; locale?: string };',
|
|
90
|
-
);
|
|
91
|
-
expect(attributesContent).toContain(
|
|
92
|
-
'export type PermissionsAttribute = ("read" | "write" | "admin")[];',
|
|
93
|
-
);
|
|
94
|
-
expect(attributesContent).toContain("export type VersionAttribute = string | number;");
|
|
95
|
-
expect(attributesContent).toContain(
|
|
96
|
-
"export type BrowserAttribute = { name?: string; version?: string };",
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
expect(contextContent).toContain("import type {");
|
|
100
|
-
expect(contextContent).toContain("AccountAttribute,");
|
|
101
|
-
expect(contextContent).toContain("PermissionsAttribute,");
|
|
102
|
-
expect(contextContent).toContain("VersionAttribute,");
|
|
103
|
-
expect(contextContent).toContain('} from "./attributes";');
|
|
104
|
-
expect(contextContent).toContain("account?: AccountAttribute;");
|
|
105
|
-
expect(contextContent).toContain("permissions?: PermissionsAttribute;");
|
|
106
|
-
expect(contextContent).toContain("version?: VersionAttribute;");
|
|
107
|
-
expect(contextContent).toContain("browser?: BrowserAttribute;");
|
|
108
|
-
|
|
109
|
-
expect(indexContent).toContain('export * from "./attributes";');
|
|
110
|
-
expect(indexContent).toContain('export * from "./features";');
|
|
111
|
-
expect(indexContent).toContain('export * from "./functions";');
|
|
112
|
-
expect(featuresContent).toContain("export type FeatureKey = keyof Features;");
|
|
113
|
-
expect(functionsContent).toContain("export function isEnabled(");
|
|
114
|
-
expect(functionsContent).toContain("export function getVariation<");
|
|
115
|
-
expect(functionsContent).toContain("export function getVariable<");
|
|
116
|
-
expect(generatedFiles.some((fileName) => fileName.endsWith("Feature.ts"))).toEqual(false);
|
|
117
|
-
expect(indexContent).not.toMatch(/Feature";/);
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
it("generates the union of repeated tags and optional React hooks", async () => {
|
|
121
|
-
const projectConfig = getProjectConfig(tempProjectPath);
|
|
122
|
-
const datasource = new Datasource(projectConfig, tempProjectPath);
|
|
123
|
-
|
|
124
|
-
await generateTypeScriptCodeForProject(
|
|
125
|
-
{
|
|
126
|
-
rootDirectoryPath: tempProjectPath,
|
|
127
|
-
projectConfig,
|
|
128
|
-
datasource,
|
|
129
|
-
options: {},
|
|
130
|
-
} as any,
|
|
131
|
-
outputPath,
|
|
132
|
-
{ tag: ["checkout", "ecommerce"], react: true },
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
const featuresContent = fs.readFileSync(path.join(outputPath, "features.ts"), "utf8");
|
|
136
|
-
const indexContent = fs.readFileSync(path.join(outputPath, "index.ts"), "utf8");
|
|
137
|
-
const generatedFiles = fs.readdirSync(outputPath).sort();
|
|
138
|
-
|
|
139
|
-
expect(featuresContent).toContain("discount: null;");
|
|
140
|
-
expect(featuresContent).toContain("pricing: {");
|
|
141
|
-
expect(featuresContent).toContain("withComplexSchema: {");
|
|
142
|
-
expect(featuresContent).not.toContain("accountTargeting:");
|
|
143
|
-
expect(generatedFiles).toContain("react.ts");
|
|
144
|
-
expect(generatedFiles.some((fileName) => fileName.endsWith("Feature.ts"))).toEqual(false);
|
|
145
|
-
expect(indexContent).toContain('export * from "./react";');
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it("generates the union of repeated targets using their full selectors", async () => {
|
|
149
|
-
fs.writeFileSync(
|
|
150
|
-
path.join(tempProjectPath, "targets", "ecommerce-code.yml"),
|
|
151
|
-
[
|
|
152
|
-
"description: Ecommerce code",
|
|
153
|
-
"tags:",
|
|
154
|
-
" and:",
|
|
155
|
-
" - all",
|
|
156
|
-
" - ecommerce",
|
|
157
|
-
"includeFeatures:",
|
|
158
|
-
" - with*",
|
|
159
|
-
"excludeFeatures:",
|
|
160
|
-
" - withMutations",
|
|
161
|
-
].join("\n"),
|
|
162
|
-
"utf8",
|
|
163
|
-
);
|
|
164
|
-
const projectConfig = getProjectConfig(tempProjectPath);
|
|
165
|
-
const datasource = new Datasource(projectConfig, tempProjectPath);
|
|
166
|
-
|
|
167
|
-
await generateTypeScriptCodeForProject(
|
|
168
|
-
{
|
|
169
|
-
rootDirectoryPath: tempProjectPath,
|
|
170
|
-
projectConfig,
|
|
171
|
-
datasource,
|
|
172
|
-
options: {},
|
|
173
|
-
} as any,
|
|
174
|
-
outputPath,
|
|
175
|
-
{ target: ["checkout", "ecommerce-code"] },
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
const featuresContent = fs.readFileSync(path.join(outputPath, "features.ts"), "utf8");
|
|
179
|
-
|
|
180
|
-
expect(featuresContent).toContain("discount: null;");
|
|
181
|
-
expect(featuresContent).toContain("pricing: {");
|
|
182
|
-
expect(featuresContent).toContain("withComplexSchema: {");
|
|
183
|
-
expect(featuresContent).not.toContain("withMutations:");
|
|
184
|
-
expect(featuresContent).not.toContain("accountTargeting:");
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
it("combines tags and targets as a union and rejects unknown selectors", async () => {
|
|
188
|
-
const projectConfig = getProjectConfig(tempProjectPath);
|
|
189
|
-
const datasource = new Datasource(projectConfig, tempProjectPath);
|
|
190
|
-
const deps = {
|
|
191
|
-
rootDirectoryPath: tempProjectPath,
|
|
192
|
-
projectConfig,
|
|
193
|
-
datasource,
|
|
194
|
-
options: {},
|
|
195
|
-
} as any;
|
|
196
|
-
|
|
197
|
-
await generateTypeScriptCodeForProject(deps, outputPath, {
|
|
198
|
-
tag: "sign-in",
|
|
199
|
-
target: "checkout",
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
const featuresContent = fs.readFileSync(path.join(outputPath, "features.ts"), "utf8");
|
|
203
|
-
expect(featuresContent).toContain("foo: {");
|
|
204
|
-
expect(featuresContent).toContain("discount: null;");
|
|
205
|
-
expect(featuresContent).not.toContain("accountTargeting:");
|
|
206
|
-
|
|
207
|
-
await expect(
|
|
208
|
-
generateTypeScriptCodeForProject(deps, outputPath, { tag: "missing" }),
|
|
209
|
-
).rejects.toThrow('Unknown tag "missing"');
|
|
210
|
-
await expect(
|
|
211
|
-
generateTypeScriptCodeForProject(deps, outputPath, { target: "missing" }),
|
|
212
|
-
).rejects.toThrow('Unknown target "missing"');
|
|
213
|
-
});
|
|
214
|
-
});
|