Skip to content

Commit dcac6cb

Browse files
committed
pdev:set
1 parent e2053a5 commit dcac6cb

File tree

7 files changed

+48
-30
lines changed

7 files changed

+48
-30
lines changed

code-generation/interfaces/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface SceMain {
1010

1111
initialize: () => void;
1212

13-
onComplete: () => void;
13+
onComplete: (x: Updateable) => void;
1414

1515
onNextEvent: (ev: SceEvent, x: Updateable) => void;
1616

code-generation/values/nodejs-mocha/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ export declare class CodeGenerator implements SceMain {
33
private rawCode;
44
private styledCode;
55
static pluginName: string;
6+
code: any;
67
constructor();
78
initialize(): void;
89
getRawGeneratedCode(): string;
910
getStyledGeneratedCode(): string;
10-
onComplete(): void;
11+
onComplete(x: Updateable): void;
1112
onNextEvent(ev: SceEvent, x: Updateable): void;
1213
}

code-generation/values/nodejs-mocha/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ var CodeGenerator = (function () {
44
function CodeGenerator() {
55
this.rawCode = '';
66
this.styledCode = '';
7+
this.code = [];
78
}
89
CodeGenerator.prototype.initialize = function () {
910
};
1011
CodeGenerator.prototype.getRawGeneratedCode = function () {
11-
return 'poodles (nodejs-mocha)';
12+
return 'poodles (nodejs-mocha) ' + this.code.join(' ');
1213
};
1314
CodeGenerator.prototype.getStyledGeneratedCode = function () {
1415
return this.styledCode;
1516
};
16-
CodeGenerator.prototype.onComplete = function () {
17+
CodeGenerator.prototype.onComplete = function (x) {
18+
this.code.push('complete');
19+
x.updateCode();
1720
};
1821
CodeGenerator.prototype.onNextEvent = function (ev, x) {
22+
this.code.push(this.code.length);
1923
x.updateCode();
2024
};
2125
CodeGenerator.pluginName = 'nodejs-mocha';

code-generation/values/nodejs-mocha/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export class CodeGenerator implements SceMain {
77
private rawCode = '';
88
private styledCode = '';
99
public static pluginName = 'nodejs-mocha';
10+
public code = [] as any;
1011

1112
constructor(){
1213

@@ -19,21 +20,22 @@ export class CodeGenerator implements SceMain {
1920
getRawGeneratedCode() {
2021
// return this.rawCode;
2122

22-
return 'poodles (nodejs-mocha)';
23+
return 'poodles (nodejs-mocha) ' + this.code.join(' ');
2324
}
2425

2526

2627
getStyledGeneratedCode() {
2728
return this.styledCode;
2829
}
2930

30-
onComplete(){
31-
31+
onComplete(x: Updateable){
32+
this.code.push('complete');
33+
x.updateCode();
3234
}
3335

34-
3536
onNextEvent(ev: SceEvent, x: Updateable) {
3637

38+
this.code.push(this.code.length);
3739
x.updateCode();
3840
}
3941

code-generation/values/nodejs-suman/lib/data-proto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export const proto = {
244244
console.error('no marker:', util.inspect(this));
245245
throw new Error('no marker');
246246
},
247-
247+
248248
getLeftMost() {
249249

250250
if (!this.left) {

code-generation/values/nodejs-suman/lib/data.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Object.defineProperty(exports, "__esModule", { value: true });
33
var data_proto_1 = require("./data-proto");
44
exports.values = {
5+
'nemo': {
6+
'left': 'begin',
7+
'middle': null,
8+
'right': 'end'
9+
},
510
'top': {
611
root: true,
712
left: '#!/usr/bin/env node',

code-generation/values/nodejs-suman/lib/data.ts

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,113 +19,119 @@ export interface ICopyable {
1919
}
2020

2121
export const values = <ICopyable> {
22-
22+
23+
'nemo': {
24+
'left': 'begin',
25+
'middle': null,
26+
'right': 'end'
27+
},
28+
2329
'top': {
2430
root: true,
2531
left: '#!/usr/bin/env node',
2632
middle: "'use strict';",
2733
right: null
2834
},
29-
35+
3036
'builder': {
3137
left: `const {Builder, By, Key, until} = require('selenium-webdriver');`
3238
},
33-
39+
3440
'driver.create': {
3541
left: `const driver = new Builder().forBrowser('firefox').build();`
3642
},
37-
43+
3844
'driver.get': {
3945
left: `await driver.get('{{driverGetURL}}');`
4046
},
41-
47+
4248
'driver.findElement': {
4349
left: `await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);`
4450
},
45-
51+
4652
'driver.quit': {
4753
left: `await driver.quit();`
4854
},
49-
55+
5056
'driver.wait.until.title': {
5157
left: `await driver.wait(until.titleIs('webdriver - Google Search'), 1000);`
5258
},
53-
59+
5460
'declare': {
5561
left: "const suman = require('suman');"
5662
},
57-
63+
5864
'init': {
5965
left: 'const {Test} = suman.init(module);'
6066
},
61-
67+
6268
'create': {
6369
name: 'create',
6470
left: 'Test.create((b, it, context, before, after, beforeEach, afterEach) => {',
6571
middle: null,
6672
right: '});'
6773
},
68-
74+
6975
'driver.find.hook': {
7076
left: 'const el = h.supply.el = await driver.find(By.id())'
7177
},
72-
78+
7379
'driver.find.testCase': {
7480
left: 'const el = t.supply.el = await driver.find(By.id())'
7581
},
76-
82+
7783
'before': {
7884
'suman.hook': true,
7985
left: 'before(async h => {',
8086
middle: null,
8187
right: '});'
8288
},
83-
89+
8490
'after.always': {
8591
'suman.hook': true,
8692
left: 'after.always(async h => {',
8793
middle: null,
8894
right: '});'
8995
},
90-
96+
9197
'after': {
9298
'suman.hook': true,
9399
left: 'after(async h => {',
94100
middle: null,
95101
right: '});'
96102
},
97-
103+
98104
'beforeEach': {
99105
'suman.hook': true,
100106
left: 'beforeEach(async h => {',
101107
middle: null,
102108
right: '});'
103109
},
104-
110+
105111
'afterEach': {
106112
'suman.hook': true,
107113
left: 'afterEach(async h => {',
108114
middle: null,
109115
right: '});'
110116
},
111-
117+
112118
'it': {
113119
left: 'it(async t => {',
114120
middle: null,
115121
right: '});'
116122
},
117-
123+
118124
'it.el': {
119125
left: 'const el = t.supply.el;',
120126
},
121-
127+
122128
'context': {
123129
'suman.block': true,
124130
left: 'context(b => {',
125131
middle: null,
126132
right: '});'
127133
}
128-
134+
129135
};
130136

131137
Object.keys(values).forEach(function (k) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy