Skip to content

Commit

Permalink
implement first test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tzAcee committed Mar 22, 2024
1 parent d9c2608 commit d45ead8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile",
"test": "extest setup-and-run out/test/ui-test/*.test.js -m ./mocharc.js"
"test": "extest setup-and-run out/test/ui-test/*.test.js -m ./mocharc.js",
"test:replacement": "extest setup-and-run out/test/ui-test/replacement-commands.test.js -m ./mocharc.js"
},
"devDependencies": {
"@types/glob": "^7.1.1",
Expand Down
14 changes: 10 additions & 4 deletions src/test/ui-test/replacement-commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ describe('Text teplacement test suite', () => {
let dirContents = fs.readdirSync(workSpaceDir);
for(let contentPath of dirContents)
{
if(!await isDirectory(contentPath))
if(!await isDirectory(workSpaceDir+"/"+contentPath))
{
fs.unlinkSync(contentPath);
fs.unlinkSync(workSpaceDir+"/"+contentPath);
}
}

Expand All @@ -54,17 +54,23 @@ describe('Text teplacement test suite', () => {
// header file name tests:
it('[header file name] - CLASSNAMEUPPER multiple', async () => {

await ext_settings.setHeaderFileNamePreset("{{*CLASSNAMEUPPER*}}.h");
await ext_settings.setHeaderFileNamePreset("{{*CLASSNAMEUPPER*}}-{{*CLASSNAMEUPPER*}}.h");
const className = "testClass";

await cppCreatorExt.openExtPromptByCmdPallette(className);

const path = workSpaceDir + "/" + className.toUpperCase() + ".h";
const path = workSpaceDir + "/" + className.toUpperCase()+"-"+ className.toUpperCase() + ".h";
assert(await ClassHelper.fileExists(path));
})

it('[header file name] - CLASSNAMEUPPER once', async () => {
await ext_settings.setHeaderFileNamePreset("{{*CLASSNAMEUPPER*}}.h");
const className = "testClass";

await cppCreatorExt.openExtPromptByCmdPallette(className);

const path = workSpaceDir + "/" + className.toUpperCase() + ".h";
assert(await ClassHelper.fileExists(path));
})

it('[header file name] - CLASSNAMECAPI once', async () => {
Expand Down
1 change: 0 additions & 1 deletion src/test/ui-test/utils/multiline-setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import assert = require("assert");
import { until } from "./util";

export async function createSetting(element: WebElement, title: string, category: string, settingsEditor: SettingsEditor): Promise<Setting> {
console.log("Creating setting");
await element.findElement(locators.SettingsEditor.settingConstructor(title, category));
try {
// try a combo setting
Expand Down

0 comments on commit d45ead8

Please sign in to comment.