Skip to content

Commit 10a8d44

Browse files
committed
@types/jasmine is added to package.json and path param
1 parent 11f22d5 commit 10a8d44

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"pegjs": "^0.10.0",
1010
"rimraf": "^3.0.2",
1111
"ts-pegjs": "^0.2.7",
12-
"yargs": "^16.1.0",
13-
"jasmine": "^3.6.2"
12+
"yargs": "^16.1.0"
1413
},
1514
"devDependencies": {
15+
"@types/jasmine": "^3.6.2",
1616
"jasmine": "^3.6.2"
1717
},
1818
"scripts": {

runners/console/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ export class Console extends Runner {
7979
return null;
8080
}
8181

82-
runCreateDevon4jProject(step: Step, command: Command): RunResult{
83-
return null;
84-
}
85-
8682
async assertInstallDevonfwIde(step: Step, command: Command, result: RunResult) {
8783
let installedTools = command.parameters[0];
8884

@@ -124,9 +120,6 @@ export class Console extends Runner {
124120
.fileExits(path.join(workspaceDir, command.parameters[0], "core", "src", "main", "java", "com", "example", "application", command.parameters[0], "SpringBootApp.java"));
125121
}
126122

127-
async assertCreateDevon4jProject(step: Step, command: Command, result: RunResult) {
128-
console.log("assertCreateDevon4jProject");
129-
}
130123

131124
private executeCommandSync(command: string, directory: string, result: RunResult, input?: string) {
132125
if(result.returnCode != 0) return;

runners/katacoda/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export class Katacoda extends Runner {
125125

126126
// generate template to change directory, if the current directory is not equal to the required start directory
127127
let cdCommand = this.changeCurrentDir(path.join("/root", "devonfw"));
128+
let cdTarget = this.changeCurrentDir(path.join(command.parameters[1]));
128129

129130
this.steps.push({
130131
"title": "Create a new project",
@@ -134,8 +135,8 @@ export class Katacoda extends Runner {
134135
//update current directory
135136
this.currentDir = path.join(this.currentDir, "workspace", "main");
136137

137-
this.renderTemplate("createDevon4jProject.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, cdCommand: cdCommand, name : command.parameters[0] });
138-
return null;
138+
this.renderTemplate("createDevon4jProject.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, cdCommand: cdCommand, cdTarget: cdTarget, name : command.parameters[0]});
139+
return null;
139140
}
140141

141142
private renderTemplate(name: string, targetPath: string, variables) {

runners/katacoda/templates/createDevon4jProject.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
<%= cdCommand; %>
66

7-
Navigate to the 'workspaces/main/' folder in your devonfw installation directory.
8-
`cd workspaces/main/`{{execute}}
7+
Navigate to the right folder in your devonfw installation directory.
8+
<%= cdTarget; %>
99

1010
Now you can use devonfw to setup a java project for you by executing the following devon command.
1111
`devon java create com.example.application.<%= name; %>`{{execute}}

spec/runners/katacoda/dirUtilsSpec.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import * as jasmine from 'jasmine';
1+
import 'jasmine';
22
import * as path from 'path';
33
import { DirUtils } from '../../../runners/katacoda/dirUtils';
44

5-
jasmine.describe("DirUtils", () => {
5+
describe("DirUtils", () => {
66
let target = new DirUtils();
7-
jasmine.describe("changeCurrentDir", () => {
8-
jasmine.it("is already in the right folder", () => {
9-
jasmine.expect(target.getCdParam(path.join('/root'), path.join('/root'))).toBe('');
7+
describe("changeCurrentDir", () => {
8+
it("is already in the right folder", () => {
9+
expect(target.getCdParam(path.join('/root'), path.join('/root'))).toBe('');
1010
});
11-
jasmine.it("changes directly to the child folder, because currentDir is the prefix of dir", () => {
12-
jasmine.expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/devonfw/setup'))).toBe(path.join('setup'));
11+
it("changes directly to the child folder, because currentDir is the prefix of dir", () => {
12+
expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/devonfw/setup'))).toBe(path.join('setup'));
1313
});
14-
jasmine.it("returns an absolute path, because both dirs don't have matching parent folders", () => {
15-
jasmine.expect(target.getCdParam(path.join('/setup'), path.join('/root/devonfw/setup'))).toBe(path.join('/root/devonfw/setup'));
14+
it("returns an absolute path, because both dirs don't have matching parent folders", () => {
15+
expect(target.getCdParam(path.join('/setup'), path.join('/root/devonfw/setup'))).toBe(path.join('/root/devonfw/setup'));
1616
});
17-
jasmine.it("changes to parent folder before changing to child folder", () => {
18-
jasmine.expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/setup/folder0/folder1'))).toBe(path.join('../setup/folder0/folder1'));
17+
it("changes to parent folder before changing to child folder", () => {
18+
expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/setup/folder0/folder1'))).toBe(path.join('../setup/folder0/folder1'));
1919
});
20-
jasmine.it("changes to parent folder before changing to child folder and one child folder has the same position and name", () => {
21-
jasmine.expect(target.getCdParam(path.join('/root/devonfw/folder/setup'), path.join('/root/devonfw/setup/setup'))).toBe(path.join('../../setup/setup'));
20+
it("changes to parent folder before changing to child folder and one child folder has the same position and name", () => {
21+
expect(target.getCdParam(path.join('/root/devonfw/folder/setup'), path.join('/root/devonfw/setup/setup'))).toBe(path.join('../../setup/setup'));
2222
});
2323

2424
});

0 commit comments

Comments
 (0)