Skip to content

Commit 7b41051

Browse files
authored
test: registry validation prevents ignoring non-supported types (#510)
* fix: registry validation prevents ignoring non-supported types * test: remove spec so test:registry runs only one test
1 parent ac64250 commit 7b41051

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.mocharc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"require": "ts-node/register,source-map-support/register",
33
"watch-extensions": "ts",
44
"extensions": [".ts", ".js", ".json"],
5-
"spec": ["./test/**/*.test.ts"],
65
"watch-files": ["src", "test"],
76
"recursive": true,
87
"reporter": "spec",

CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ All notable changes to this project will be documented in this file. See [standa
66

77
## [5.7.0](https://github.com/forcedotcom/source-deploy-retrieve/compare/v5.6.4...v5.7.0) (2021-11-24)
88

9-
109
### Features
1110

12-
* add metadata types StnryAssetEnvSrcCnfg, BldgEnrgyIntensityCnfg, VehicleAssetEmssnSrcCnfg ([#508](https://github.com/forcedotcom/source-deploy-retrieve/issues/508)) ([e3dc3ef](https://github.com/forcedotcom/source-deploy-retrieve/commit/e3dc3ef51d8fba19ec9dfda43ca41ddaf26c9bc0))
11+
- add metadata types StnryAssetEnvSrcCnfg, BldgEnrgyIntensityCnfg, VehicleAssetEmssnSrcCnfg ([#508](https://github.com/forcedotcom/source-deploy-retrieve/issues/508)) ([e3dc3ef](https://github.com/forcedotcom/source-deploy-retrieve/commit/e3dc3ef51d8fba19ec9dfda43ca41ddaf26c9bc0))
1312

1413
### [5.6.4](https://github.com/forcedotcom/source-deploy-retrieve/compare/v5.6.3...v5.6.4) (2021-11-22)
1514

16-
1715
### Bug Fixes
1816

19-
* run unspecified child types through forceignore to avoid retrieving ([#505](https://github.com/forcedotcom/source-deploy-retrieve/issues/505)) ([4e327b6](https://github.com/forcedotcom/source-deploy-retrieve/commit/4e327b60de27168dc0b3e8a63ba70dbce96df03a))
17+
- run unspecified child types through forceignore to avoid retrieving ([#505](https://github.com/forcedotcom/source-deploy-retrieve/issues/505)) ([4e327b6](https://github.com/forcedotcom/source-deploy-retrieve/commit/4e327b60de27168dc0b3e8a63ba70dbce96df03a))
2018

2119
### [5.6.3](https://github.com/forcedotcom/source-deploy-retrieve/compare/v5.6.2...v5.6.3) (2021-11-18)
2220

test/registry/registryValidation.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,28 @@
77
import { expect } from 'chai';
88
import { MetadataRegistry } from '../../src';
99
import { registry as defaultRegistry } from '../../src/registry/registry';
10+
import { metadataTypes as UnsupportedTypes } from '../../src/registry/nonSupportedTypes';
1011
import { MetadataType, TransformerStrategy, DecompositionStrategy } from '../../src/registry/types';
1112

1213
describe('Registry Validation', () => {
1314
const registry = defaultRegistry as MetadataRegistry;
1415
const typesWithChildren = Object.values(registry.types).filter((type) => type.children);
1516

17+
describe('non-supported types', () => {
18+
Object.values(registry.types).forEach((type) => {
19+
it(`${type.name} should not be in UnsupportedTypes`, () => {
20+
expect(UnsupportedTypes).to.not.include(type.name);
21+
});
22+
});
23+
typesWithChildren.forEach((type) => {
24+
Object.values(type.children.types).forEach((child) => {
25+
it(`${child.name} should not be in UnsupportedTypes`, () => {
26+
expect(UnsupportedTypes).to.not.include(child.name);
27+
});
28+
});
29+
});
30+
});
31+
1632
describe('child types', () => {
1733
describe('child types are configured properly', () => {
1834
typesWithChildren.forEach((type) => {

0 commit comments

Comments
 (0)