Skip to content

Commit 9d71ef5

Browse files
Merge pull request #40 from gemini-testing/TESTPLANE-263.config_name
feat: use 'testplane.config.[tj]s' config name
2 parents 4603173 + 2bff575 commit 9d71ef5

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

src/constants/packageManagement.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
export const PACKAGE_JSON = "package.json";
22

33
export const CONFIG_NAMES = {
4+
TESTPLANE_NEW_TS: "testplane.config.ts",
5+
TESTPLANE_NEW_CTS: "testplane.config.cts",
6+
TESTPLANE_NEW_JS: "testplane.config.js",
7+
TESTPLANE_NEW_CJS: "testplane.config.cjs",
48
TESTPLANE_TS: ".testplane.conf.ts",
59
TESTPLANE_JS: ".testplane.conf.js",
6-
HERMIONE_TS: ".hermione.conf.ts", // drop after testplane@2
7-
HERMIONE_JS: ".hermione.conf.js", // drop after testplane@2
10+
HERMIONE_TS: ".hermione.conf.ts", // drop after testplane@9
11+
HERMIONE_JS: ".hermione.conf.js", // drop after testplane@9
812
} as const;
913

1014
export const DEFAULT_PM = "npm";

src/fsUtils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe("fsUtils", () => {
3737

3838
await fsUtils.writeTestplaneConfig("/", config);
3939

40-
expect(fsPromises.writeFile).toBeCalledWith(`/.testplane.conf.${ext}`, expectedConfigWritten);
40+
expect(fsPromises.writeFile).toBeCalledWith(`/testplane.config.${ext}`, expectedConfigWritten);
4141
};
4242

4343
it("js config", async () => {

src/package.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ describe("package", () => {
1212
});
1313

1414
describe("initApp", () => {
15-
[".testplane.conf.ts", ".testplane.conf.js", ".hermione.conf.ts", ".hermione.conf.js"].forEach(configName => {
15+
[
16+
".testplane.conf.ts",
17+
".testplane.conf.js",
18+
".hermione.conf.ts",
19+
".hermione.conf.js",
20+
"testplane.config.ts",
21+
"testplane.config.cjs",
22+
].forEach(configName => {
1623
it(`should throw an error, if ${configName} exists`, async () => {
1724
const dirPath = "/dir/path";
1825
jest.mocked(fsUtils.exists).mockImplementation(file =>

src/utils/configTemplates/js.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ConfigTemplate } from ".";
22
import { CONFIG_NAMES } from "../../constants/packageManagement";
33

44
export const jsTemplate: ConfigTemplate = {
5-
fileName: CONFIG_NAMES.TESTPLANE_JS,
5+
fileName: CONFIG_NAMES.TESTPLANE_NEW_JS,
66
language: "js",
77
quote: "'",
88
getImportModule: (importName, moduleName) => `const ${importName} = require('${moduleName}');`,

src/utils/configTemplates/ts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ConfigTemplate } from ".";
22
import { CONFIG_NAMES } from "../../constants/packageManagement";
33

44
export const tsTemplate: ConfigTemplate = {
5-
fileName: CONFIG_NAMES.TESTPLANE_TS,
5+
fileName: CONFIG_NAMES.TESTPLANE_NEW_TS,
66
language: "ts",
77
quote: '"',
88
getImportModule: (importName, moduleName) => `import ${importName} from "${moduleName}";`,

0 commit comments

Comments
 (0)