Skip to content

Commit

Permalink
feat: remove feature flag for 1.3 schema
Browse files Browse the repository at this point in the history
  • Loading branch information
a1exwang committed Oct 27, 2023
1 parent b3c51f0 commit eb4b9e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 2 additions & 3 deletions packages/fx-core/src/component/configManager/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import Ajv, { ValidateFunction } from "ajv";
import fs from "fs-extra";
import path from "path";
import { getResourceFolder } from "../../folder";
import { isTestToolEnabled } from "../../common/featureFlags";

type Version = string;
const supportedVersions = ["1.0.0", "1.1.0", "v1.2"];
const supportedVersions = ["1.0.0", "1.1.0", "v1.2", "v1.3"];

export class Validator {
impl: Map<Version, { validator: ValidateFunction }>;
Expand Down Expand Up @@ -36,7 +35,7 @@ export class Validator {
}

supportedVersions(): string[] {
return [...supportedVersions, ...(isTestToolEnabled() ? ["v1.3"] : [])];
return supportedVersions;
}

private latestSupportedVersion(): string {
Expand Down
10 changes: 2 additions & 8 deletions packages/fx-core/tests/component/configManager/validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import chai from "chai";
import { describe, it } from "mocha";
import { Validator } from "../../../src/component/configManager/validator";
import * as sinon from "sinon";
import * as featureFlags from "../../../src/common/featureFlags";

describe("yaml validator", () => {
const validator = new Validator();
afterEach(() => {
Expand All @@ -26,11 +24,7 @@ describe("yaml validator", () => {
.expect(validator.supportedVersions())
.contains("1.0.0")
.and.contains("1.1.0")
.and.contains("v1.2");
});

it("should support v1.3 for test tool", () => {
sinon.stub(featureFlags, "isTestToolEnabled").resolves(true);
chai.expect(validator.supportedVersions()).contain("v1.3");
.and.contains("v1.2")
.and.contains("v1.3");
});
});

0 comments on commit eb4b9e5

Please sign in to comment.