@featurevisor/core 2.6.7 → 2.7.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/coverage/clover.xml +63 -59
  3. package/coverage/coverage-final.json +2 -2
  4. package/coverage/lcov-report/index.html +23 -23
  5. package/coverage/lcov-report/lib/builder/allocator.js.html +1 -1
  6. package/coverage/lcov-report/lib/builder/buildScopedConditions.js.html +1 -1
  7. package/coverage/lcov-report/lib/builder/buildScopedDatafile.js.html +1 -1
  8. package/coverage/lcov-report/lib/builder/buildScopedSegments.js.html +1 -1
  9. package/coverage/lcov-report/lib/builder/index.html +1 -1
  10. package/coverage/lcov-report/lib/builder/revision.js.html +1 -1
  11. package/coverage/lcov-report/lib/builder/traffic.js.html +1 -1
  12. package/coverage/lcov-report/lib/list/index.html +15 -15
  13. package/coverage/lcov-report/lib/list/matrix.js.html +18 -9
  14. package/coverage/lcov-report/lib/tester/helpers.js.html +1 -1
  15. package/coverage/lcov-report/lib/tester/index.html +1 -1
  16. package/coverage/lcov-report/src/builder/allocator.ts.html +1 -1
  17. package/coverage/lcov-report/src/builder/buildScopedConditions.ts.html +1 -1
  18. package/coverage/lcov-report/src/builder/buildScopedDatafile.ts.html +1 -1
  19. package/coverage/lcov-report/src/builder/buildScopedSegments.ts.html +1 -1
  20. package/coverage/lcov-report/src/builder/index.html +1 -1
  21. package/coverage/lcov-report/src/builder/revision.ts.html +1 -1
  22. package/coverage/lcov-report/src/builder/traffic.ts.html +1 -1
  23. package/coverage/lcov-report/src/list/index.html +15 -15
  24. package/coverage/lcov-report/src/list/matrix.ts.html +18 -9
  25. package/coverage/lcov-report/src/tester/helpers.ts.html +1 -1
  26. package/coverage/lcov-report/src/tester/index.html +1 -1
  27. package/coverage/lcov.info +81 -74
  28. package/lib/linter/testSchema.d.ts +5 -0
  29. package/lib/linter/testSchema.js +6 -1
  30. package/lib/linter/testSchema.js.map +1 -1
  31. package/lib/list/matrix.js +4 -1
  32. package/lib/list/matrix.js.map +1 -1
  33. package/lib/tester/testFeature.js +6 -1
  34. package/lib/tester/testFeature.js.map +1 -1
  35. package/lib/tester/testProject.d.ts +1 -0
  36. package/lib/tester/testProject.js +28 -2
  37. package/lib/tester/testProject.js.map +1 -1
  38. package/package.json +5 -5
  39. package/src/linter/testSchema.ts +9 -1
  40. package/src/list/matrix.ts +4 -1
  41. package/src/tester/testFeature.ts +6 -1
  42. package/src/tester/testProject.ts +41 -2
@@ -23,6 +23,7 @@ export interface TestProjectOptions {
23
23
  schemaVersion?: string;
24
24
  inflate?: number;
25
25
  withScopes?: boolean;
26
+ withTags?: boolean;
26
27
  }
27
28
 
28
29
  export interface ExecutionResult {
@@ -173,7 +174,26 @@ export async function testProject(
173
174
  }
174
175
  }
175
176
 
176
- // @TODO: by tag
177
+ // by tag
178
+ if (projectConfig.tags && options.withTags) {
179
+ for (const tag of projectConfig.tags) {
180
+ const existingState = await datasource.readState(environment);
181
+ const datafileContent = (await buildDatafile(
182
+ projectConfig,
183
+ datasource,
184
+ {
185
+ schemaVersion: options.schemaVersion || SCHEMA_VERSION,
186
+ revision: "include-tagged-features",
187
+ environment: environment,
188
+ inflate: options.inflate,
189
+ tag: tag,
190
+ },
191
+ existingState,
192
+ )) as DatafileContent;
193
+
194
+ datafileContentByKey.set(`${environment}-tag-${tag}`, datafileContent);
195
+ }
196
+ }
177
197
  }
178
198
  }
179
199
 
@@ -221,7 +241,26 @@ export async function testProject(
221
241
  }
222
242
  }
223
243
 
224
- // @TODO: by tag
244
+ // by tag
245
+ if (projectConfig.tags && options.withTags) {
246
+ for (const tag of projectConfig.tags) {
247
+ const existingState = await datasource.readState(false);
248
+ const datafileContent = (await buildDatafile(
249
+ projectConfig,
250
+ datasource,
251
+ {
252
+ schemaVersion: options.schemaVersion || SCHEMA_VERSION,
253
+ revision: "include-tagged-features",
254
+ environment: false,
255
+ inflate: options.inflate,
256
+ tag: tag,
257
+ },
258
+ existingState,
259
+ )) as DatafileContent;
260
+
261
+ datafileContentByKey.set(`tag-${tag}`, datafileContent);
262
+ }
263
+ }
225
264
  }
226
265
 
227
266
  const tests = await listEntities<Test>(