@seleniumhq/code-export-csharp-nunit 3.17.4 → 4.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/command.d.ts +3 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +23 -0
- package/dist/command.js.map +1 -0
- package/dist/hook.d.ts +87 -0
- package/dist/hook.d.ts.map +1 -0
- package/dist/hook.js +134 -0
- package/dist/hook.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +116 -0
- package/dist/index.js.map +1 -0
- package/package.json +11 -15
- package/src/{command.js → command.ts} +1 -22
- package/src/{hook.js → hook.ts} +5 -22
- package/src/index.ts +140 -0
- package/tsconfig.json +18 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/.babelrc +0 -13
- package/src/index.js +0 -138
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAA;AAGhE,eAAe,OAAO,CAAA"}
|
package/dist/command.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
3
|
+
// or more contributor license agreements. See the NOTICE file
|
|
4
|
+
// distributed with this work for additional information
|
|
5
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
6
|
+
// to you under the Apache License, Version 2.0 (the
|
|
7
|
+
// "License"); you may not use this file except in compliance
|
|
8
|
+
// with the License. You may obtain a copy of the License at
|
|
9
|
+
//
|
|
10
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
//
|
|
12
|
+
// Unless required by applicable law or agreed to in writing,
|
|
13
|
+
// software distributed under the License is distributed on an
|
|
14
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
// KIND, either express or implied. See the License for the
|
|
16
|
+
// specific language governing permissions and limitations
|
|
17
|
+
// under the License.
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
const side_code_export_1 = require("@seleniumhq/side-code-export");
|
|
20
|
+
const code_export_csharp_commons_1 = require("@seleniumhq/code-export-csharp-commons");
|
|
21
|
+
side_code_export_1.codeExport.register.preprocessors(code_export_csharp_commons_1.Command.emitters);
|
|
22
|
+
exports.default = code_export_csharp_commons_1.Command;
|
|
23
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;;AAErB,mEAAqE;AACrE,uFAAgE;AAEhE,6BAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,oCAAO,CAAC,QAAQ,CAAC,CAAA;AACjD,kBAAe,oCAAO,CAAA"}
|
package/dist/hook.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
declare const emitters: {
|
|
2
|
+
readonly afterAll: typeof afterAll;
|
|
3
|
+
readonly afterEach: typeof afterEach;
|
|
4
|
+
readonly beforeAll: typeof beforeAll;
|
|
5
|
+
readonly beforeEach: typeof beforeEach;
|
|
6
|
+
readonly declareDependencies: typeof declareDependencies;
|
|
7
|
+
readonly declareVariables: typeof declareVariables;
|
|
8
|
+
};
|
|
9
|
+
export default emitters;
|
|
10
|
+
declare function afterAll(): {
|
|
11
|
+
startingSyntax: {
|
|
12
|
+
commands: {
|
|
13
|
+
level: number;
|
|
14
|
+
statement: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
endingSyntax: {
|
|
18
|
+
commands: {
|
|
19
|
+
level: number;
|
|
20
|
+
statement: string;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
registrationLevel: number;
|
|
24
|
+
};
|
|
25
|
+
declare function afterEach(): {
|
|
26
|
+
startingSyntax: {
|
|
27
|
+
commands: {
|
|
28
|
+
level: number;
|
|
29
|
+
statement: string;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
endingSyntax: {
|
|
33
|
+
commands: {
|
|
34
|
+
level: number;
|
|
35
|
+
statement: string;
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
declare function beforeAll(): {
|
|
40
|
+
startingSyntax: {
|
|
41
|
+
commands: {
|
|
42
|
+
level: number;
|
|
43
|
+
statement: string;
|
|
44
|
+
}[];
|
|
45
|
+
};
|
|
46
|
+
endingSyntax: {
|
|
47
|
+
commands: {
|
|
48
|
+
level: number;
|
|
49
|
+
statement: string;
|
|
50
|
+
}[];
|
|
51
|
+
};
|
|
52
|
+
registrationLevel: number;
|
|
53
|
+
};
|
|
54
|
+
declare function beforeEach(): {
|
|
55
|
+
startingSyntax: ({ browserName, gridUrl }?: {
|
|
56
|
+
browserName: string;
|
|
57
|
+
gridUrl: string;
|
|
58
|
+
}) => {
|
|
59
|
+
commands: {
|
|
60
|
+
level: number;
|
|
61
|
+
statement: string;
|
|
62
|
+
}[];
|
|
63
|
+
};
|
|
64
|
+
endingSyntax: {
|
|
65
|
+
commands: {
|
|
66
|
+
level: number;
|
|
67
|
+
statement: string;
|
|
68
|
+
}[];
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
declare function declareDependencies(): {
|
|
72
|
+
startingSyntax: {
|
|
73
|
+
commands: {
|
|
74
|
+
level: number;
|
|
75
|
+
statement: string;
|
|
76
|
+
}[];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
declare function declareVariables(): {
|
|
80
|
+
startingSyntax: {
|
|
81
|
+
commands: {
|
|
82
|
+
level: number;
|
|
83
|
+
statement: string;
|
|
84
|
+
}[];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../src/hook.ts"],"names":[],"mappings":"AAiBA,QAAA,MAAM,QAAQ;;;;;;;CAOJ,CAAA;AAEV,eAAe,QAAQ,CAAA;AAEvB,iBAAS,QAAQ;;;;;;;;;;;;;;EAchB;AAED,iBAAS,SAAS;;;;;;;;;;;;;EAcjB;AAED,iBAAS,SAAS;;;;;;;;;;;;;;EAcjB;AAED,iBAAS,UAAU;;;;;;;;;;;;;;;;EA4BlB;AAED,iBAAS,mBAAmB;;;;;;;EAoB3B;AAED,iBAAS,gBAAgB;;;;;;;EAexB"}
|
package/dist/hook.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
3
|
+
// or more contributor license agreements. See the NOTICE file
|
|
4
|
+
// distributed with this work for additional information
|
|
5
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
6
|
+
// to you under the Apache License, Version 2.0 (the
|
|
7
|
+
// "License"); you may not use this file except in compliance
|
|
8
|
+
// with the License. You may obtain a copy of the License at
|
|
9
|
+
//
|
|
10
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
//
|
|
12
|
+
// Unless required by applicable law or agreed to in writing,
|
|
13
|
+
// software distributed under the License is distributed on an
|
|
14
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
// KIND, either express or implied. See the License for the
|
|
16
|
+
// specific language governing permissions and limitations
|
|
17
|
+
// under the License.
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
const emitters = {
|
|
20
|
+
afterAll,
|
|
21
|
+
afterEach,
|
|
22
|
+
beforeAll,
|
|
23
|
+
beforeEach,
|
|
24
|
+
declareDependencies,
|
|
25
|
+
declareVariables,
|
|
26
|
+
};
|
|
27
|
+
exports.default = emitters;
|
|
28
|
+
function afterAll() {
|
|
29
|
+
const params = {
|
|
30
|
+
startingSyntax: {
|
|
31
|
+
commands: [
|
|
32
|
+
{ level: 0, statement: '[OneTimeTearDown]' },
|
|
33
|
+
{ level: 0, statement: 'public void FinalTearDown() {' },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
endingSyntax: {
|
|
37
|
+
commands: [{ level: 0, statement: '}' }],
|
|
38
|
+
},
|
|
39
|
+
registrationLevel: 1,
|
|
40
|
+
};
|
|
41
|
+
return params;
|
|
42
|
+
}
|
|
43
|
+
function afterEach() {
|
|
44
|
+
const params = {
|
|
45
|
+
startingSyntax: {
|
|
46
|
+
commands: [
|
|
47
|
+
{ level: 0, statement: '[TearDown]' },
|
|
48
|
+
{ level: 0, statement: 'protected void TearDown() {' },
|
|
49
|
+
{ level: 1, statement: 'driver.Quit();' },
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
endingSyntax: {
|
|
53
|
+
commands: [{ level: 0, statement: '}' }],
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
return params;
|
|
57
|
+
}
|
|
58
|
+
function beforeAll() {
|
|
59
|
+
const params = {
|
|
60
|
+
startingSyntax: {
|
|
61
|
+
commands: [
|
|
62
|
+
{ level: 0, statement: '[OneTimeSetUp]' },
|
|
63
|
+
{ level: 0, statement: 'public void InitialSetUp() {' },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
endingSyntax: {
|
|
67
|
+
commands: [{ level: 0, statement: '}' }],
|
|
68
|
+
},
|
|
69
|
+
registrationLevel: 1,
|
|
70
|
+
};
|
|
71
|
+
return params;
|
|
72
|
+
}
|
|
73
|
+
function beforeEach() {
|
|
74
|
+
const params = {
|
|
75
|
+
startingSyntax: ({ browserName, gridUrl } = { browserName: '', gridUrl: '' }) => ({
|
|
76
|
+
commands: [
|
|
77
|
+
{ level: 0, statement: '[SetUp]' },
|
|
78
|
+
{ level: 0, statement: 'public void SetUp() {' },
|
|
79
|
+
{
|
|
80
|
+
level: 1,
|
|
81
|
+
statement: gridUrl
|
|
82
|
+
? `driver = new RemoteWebDriver(new Uri("${gridUrl}"), new ${browserName ? browserName : 'Chrome'}Options().ToCapabilities());`
|
|
83
|
+
: `driver = new ${browserName ? browserName : 'Chrome'}Driver();`,
|
|
84
|
+
},
|
|
85
|
+
{ level: 1, statement: 'js = (IJavaScriptExecutor)driver;' },
|
|
86
|
+
{
|
|
87
|
+
level: 1,
|
|
88
|
+
statement: 'vars = new Dictionary<string, object>();',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
}),
|
|
92
|
+
endingSyntax: {
|
|
93
|
+
commands: [{ level: 0, statement: '}' }],
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
return params;
|
|
97
|
+
}
|
|
98
|
+
function declareDependencies() {
|
|
99
|
+
const params = {
|
|
100
|
+
startingSyntax: {
|
|
101
|
+
commands: [
|
|
102
|
+
{ level: 0, statement: 'using System;' },
|
|
103
|
+
{ level: 0, statement: 'using System.Collections;' },
|
|
104
|
+
{ level: 0, statement: 'using System.Collections.Generic;' },
|
|
105
|
+
{ level: 0, statement: 'using System.Linq;' },
|
|
106
|
+
{ level: 0, statement: 'using System.Threading;' },
|
|
107
|
+
{ level: 0, statement: 'using OpenQA.Selenium;' },
|
|
108
|
+
{ level: 0, statement: 'using OpenQA.Selenium.Chrome;' },
|
|
109
|
+
{ level: 0, statement: 'using OpenQA.Selenium.Firefox;' },
|
|
110
|
+
{ level: 0, statement: `using OpenQA.Selenium.Remote;` },
|
|
111
|
+
{ level: 0, statement: 'using OpenQA.Selenium.Support.UI;' },
|
|
112
|
+
{ level: 0, statement: 'using OpenQA.Selenium.Interactions;' },
|
|
113
|
+
{ level: 0, statement: 'using NUnit.Framework;' },
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
return params;
|
|
118
|
+
}
|
|
119
|
+
function declareVariables() {
|
|
120
|
+
const params = {
|
|
121
|
+
startingSyntax: {
|
|
122
|
+
commands: [
|
|
123
|
+
{ level: 0, statement: 'private IWebDriver driver;' },
|
|
124
|
+
{
|
|
125
|
+
level: 0,
|
|
126
|
+
statement: 'public IDictionary<string, object> vars {get; private set;}',
|
|
127
|
+
},
|
|
128
|
+
{ level: 0, statement: 'private IJavaScriptExecutor js;' },
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
return params;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=hook.js.map
|
package/dist/hook.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../src/hook.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;;AAErB,MAAM,QAAQ,GAAG;IACf,QAAQ;IACR,SAAS;IACT,SAAS;IACT,UAAU;IACV,mBAAmB;IACnB,gBAAgB;CACR,CAAA;AAEV,kBAAe,QAAQ,CAAA;AAEvB,SAAS,QAAQ;IACf,MAAM,MAAM,GAAG;QACb,cAAc,EAAE;YACd,QAAQ,EAAE;gBACR,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE;gBAC5C,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,+BAA+B,EAAE;aACzD;SACF;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,CAAC,EAAE,KAA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A+B,EAAE;gBACxD,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,mCAAmC,EAAE;gBAC5D,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,qCAAqC,EAAE;gBAC9D,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,wBAAwB,EAAE;aAClD;SACF;KACF,CAAA;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,gBAAgB;IACvB,MAAM,MAAM,GAAG;QACb,cAAc,EAAE;YACd,QAAQ,EAAE;gBACR,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,4BAA4B,EAAE;gBACrD;oBACE,KAAK,EAAE,CAAC;oBACR,SAAS,EACP,6DAA6D;iBAChE;gBACD,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,iCAAiC,EAAE;aAC3D;SACF;KACF,CAAA;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LanguageEmitter, LanguageEmitterOpts } from '@seleniumhq/side-code-export';
|
|
2
|
+
export declare const displayName = "C# NUnit";
|
|
3
|
+
export declare const opts: LanguageEmitterOpts;
|
|
4
|
+
declare const language: LanguageEmitter;
|
|
5
|
+
export default language;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAGL,eAAe,EACf,mBAAmB,EACpB,MAAM,8BAA8B,CAAA;AAMrC,eAAO,MAAM,WAAW,aAAa,CAAA;AAErC,eAAO,MAAM,IAAI,EAAE,mBA2BlB,CAAA;AAKD,QAAA,MAAM,QAAQ,EAAE,eA2Ef,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
3
|
+
// or more contributor license agreements. See the NOTICE file
|
|
4
|
+
// distributed with this work for additional information
|
|
5
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
6
|
+
// to you under the Apache License, Version 2.0 (the
|
|
7
|
+
// "License"); you may not use this file except in compliance
|
|
8
|
+
// with the License. You may obtain a copy of the License at
|
|
9
|
+
//
|
|
10
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
//
|
|
12
|
+
// Unless required by applicable law or agreed to in writing,
|
|
13
|
+
// software distributed under the License is distributed on an
|
|
14
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
// KIND, either express or implied. See the License for the
|
|
16
|
+
// specific language governing permissions and limitations
|
|
17
|
+
// under the License.
|
|
18
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.opts = exports.displayName = void 0;
|
|
23
|
+
const side_code_export_1 = require("@seleniumhq/side-code-export");
|
|
24
|
+
const command_1 = __importDefault(require("./command"));
|
|
25
|
+
const code_export_csharp_commons_1 = require("@seleniumhq/code-export-csharp-commons");
|
|
26
|
+
const hook_1 = __importDefault(require("./hook"));
|
|
27
|
+
// Define language options
|
|
28
|
+
exports.displayName = 'C# NUnit';
|
|
29
|
+
exports.opts = {
|
|
30
|
+
displayName: exports.displayName,
|
|
31
|
+
name: 'csharp-nunit',
|
|
32
|
+
emitter: command_1.default,
|
|
33
|
+
hooks: (0, side_code_export_1.generateHooks)(hook_1.default),
|
|
34
|
+
fileExtension: '.cs',
|
|
35
|
+
commandPrefixPadding: ' ',
|
|
36
|
+
terminatingKeyword: '}',
|
|
37
|
+
commentPrefix: '//',
|
|
38
|
+
generateFilename: (name) => {
|
|
39
|
+
return `${side_code_export_1.codeExport.parsers.capitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}Test${exports.opts.fileExtension}`;
|
|
40
|
+
},
|
|
41
|
+
generateMethodDeclaration: (name) => {
|
|
42
|
+
return `public void ${side_code_export_1.codeExport.parsers.sanitizeName(name)}() {`;
|
|
43
|
+
},
|
|
44
|
+
generateTestDeclaration: (name) => {
|
|
45
|
+
return `[Test]\npublic void ${side_code_export_1.codeExport.parsers.uncapitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}() {`;
|
|
46
|
+
},
|
|
47
|
+
generateSuiteDeclaration: (name) => {
|
|
48
|
+
return `[TestFixture]\npublic class ${side_code_export_1.codeExport.parsers.capitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}Test {`;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
// Create generators for dynamic string creation of primary entities (e.g., filename, methods, test, and suite)
|
|
52
|
+
// Emit an individual test, wrapped in a suite (using the test name as the suite name)
|
|
53
|
+
const language = {
|
|
54
|
+
emit: {
|
|
55
|
+
test: async function emitTest({ test, tests, project, enableOriginTracing, beforeEachOptions, enableDescriptionAsComment, }) {
|
|
56
|
+
const testDeclaration = exports.opts.generateTestDeclaration(test.name);
|
|
57
|
+
const result = await side_code_export_1.codeExport.emit.test(test, tests, {
|
|
58
|
+
...exports.opts,
|
|
59
|
+
testDeclaration,
|
|
60
|
+
enableOriginTracing,
|
|
61
|
+
enableDescriptionAsComment,
|
|
62
|
+
project,
|
|
63
|
+
});
|
|
64
|
+
const suiteName = test.name;
|
|
65
|
+
const suiteDeclaration = exports.opts.generateSuiteDeclaration(suiteName);
|
|
66
|
+
const _suite = await side_code_export_1.codeExport.emit.suite(result, tests, {
|
|
67
|
+
...exports.opts,
|
|
68
|
+
suiteDeclaration,
|
|
69
|
+
suiteName,
|
|
70
|
+
project,
|
|
71
|
+
beforeEachOptions,
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
filename: exports.opts.generateFilename(test.name),
|
|
75
|
+
body: side_code_export_1.codeExport.emit.orderedSuite(_suite),
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
suite: async function emitSuite({ suite, tests, project, enableOriginTracing, beforeEachOptions, enableDescriptionAsComment, }) {
|
|
79
|
+
const result = await side_code_export_1.codeExport.emit.testsFromSuite(tests, suite, exports.opts, {
|
|
80
|
+
enableOriginTracing,
|
|
81
|
+
enableDescriptionAsComment,
|
|
82
|
+
generateTestDeclaration: exports.opts.generateTestDeclaration,
|
|
83
|
+
project,
|
|
84
|
+
});
|
|
85
|
+
const suiteDeclaration = exports.opts.generateSuiteDeclaration(suite.name);
|
|
86
|
+
const _suite = await side_code_export_1.codeExport.emit.suite(result, tests, {
|
|
87
|
+
...exports.opts,
|
|
88
|
+
suiteDeclaration,
|
|
89
|
+
suite,
|
|
90
|
+
suiteName: suite.name,
|
|
91
|
+
project,
|
|
92
|
+
beforeEachOptions,
|
|
93
|
+
});
|
|
94
|
+
return {
|
|
95
|
+
filename: exports.opts.generateFilename(suite.name),
|
|
96
|
+
body: side_code_export_1.codeExport.emit.orderedSuite(_suite),
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
locator: code_export_csharp_commons_1.location.emit,
|
|
100
|
+
command: command_1.default.emit,
|
|
101
|
+
},
|
|
102
|
+
opts: exports.opts,
|
|
103
|
+
register: {
|
|
104
|
+
command: command_1.default.register,
|
|
105
|
+
variable: exports.opts.hooks.declareVariables.register,
|
|
106
|
+
dependency: exports.opts.hooks.declareDependencies.register,
|
|
107
|
+
beforeAll: exports.opts.hooks.beforeAll.register,
|
|
108
|
+
beforeEach: exports.opts.hooks.beforeEach.register,
|
|
109
|
+
afterEach: exports.opts.hooks.afterEach.register,
|
|
110
|
+
afterAll: exports.opts.hooks.afterAll.register,
|
|
111
|
+
inEachBegin: exports.opts.hooks.inEachBegin.register,
|
|
112
|
+
inEachEnd: exports.opts.hooks.inEachEnd.register,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
exports.default = language;
|
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YAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ;QACtC,WAAW,EAAE,YAAI,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ;QAC5C,SAAS,EAAE,YAAI,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ;KACzC;CACF,CAAA;AAED,kBAAe,QAAQ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seleniumhq/code-export-csharp-nunit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.0",
|
|
4
4
|
"description": "Export Selenium IDE project contents to C# NUnit",
|
|
5
5
|
"repository": "https://github.com/SeleniumHQ/selenium-ide",
|
|
6
6
|
"keywords": [
|
|
@@ -9,20 +9,16 @@
|
|
|
9
9
|
"export"
|
|
10
10
|
],
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
|
-
"private": false,
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "babel -d dist src --ignore=__test__",
|
|
15
|
-
"watch": "yarn build -w"
|
|
16
|
-
},
|
|
17
12
|
"main": "dist/index.js",
|
|
18
|
-
"
|
|
19
|
-
"@babel/cli": "^7.4.4",
|
|
20
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.4.4",
|
|
21
|
-
"@babel/preset-env": "^7.4.5"
|
|
22
|
-
},
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
23
14
|
"dependencies": {
|
|
24
|
-
"@seleniumhq/code-export-csharp-commons": "^
|
|
25
|
-
"@seleniumhq/side-code-export": "^4.0.0-alpha.
|
|
15
|
+
"@seleniumhq/code-export-csharp-commons": "^4.0.0-alpha.0",
|
|
16
|
+
"@seleniumhq/side-code-export": "^4.0.0-alpha.2"
|
|
26
17
|
},
|
|
27
|
-
"gitHead": "
|
|
28
|
-
|
|
18
|
+
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo node_modules",
|
|
22
|
+
"watch": "tsc --watch"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -19,25 +19,4 @@ import { codeExport as exporter } from '@seleniumhq/side-code-export'
|
|
|
19
19
|
import { Command } from '@seleniumhq/code-export-csharp-commons'
|
|
20
20
|
|
|
21
21
|
exporter.register.preprocessors(Command.emitters)
|
|
22
|
-
|
|
23
|
-
function register(command, emitter) {
|
|
24
|
-
exporter.register.emitter({ command, emitter, emitters: Command.emitters })
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function emit(command) {
|
|
28
|
-
return exporter.emit.command(command, Command.emitters[command.command], {
|
|
29
|
-
variableLookup: Command.variableLookup,
|
|
30
|
-
emitNewWindowHandling: Command.extras.emitNewWindowHandling,
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function canEmit(commandName) {
|
|
35
|
-
return !!Command.emitters[commandName]
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
canEmit,
|
|
40
|
-
emit,
|
|
41
|
-
register,
|
|
42
|
-
extras: { emitWaitForWindow: Command.extras.emitWaitForWindow },
|
|
43
|
-
}
|
|
22
|
+
export default Command
|
package/src/{hook.js → hook.ts}
RENAMED
|
@@ -15,31 +15,16 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
import { codeExport as exporter } from '@seleniumhq/side-code-export'
|
|
19
|
-
|
|
20
18
|
const emitters = {
|
|
21
19
|
afterAll,
|
|
22
20
|
afterEach,
|
|
23
21
|
beforeAll,
|
|
24
22
|
beforeEach,
|
|
25
23
|
declareDependencies,
|
|
26
|
-
declareMethods: empty,
|
|
27
24
|
declareVariables,
|
|
28
|
-
|
|
29
|
-
inEachEnd: empty,
|
|
30
|
-
}
|
|
25
|
+
} as const
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
return new exporter.hook(emitters[hookName]())
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function generateHooks() {
|
|
37
|
-
let result = {}
|
|
38
|
-
Object.keys(emitters).forEach(hookName => {
|
|
39
|
-
result[hookName] = generate(hookName)
|
|
40
|
-
})
|
|
41
|
-
return result
|
|
42
|
-
}
|
|
27
|
+
export default emitters
|
|
43
28
|
|
|
44
29
|
function afterAll() {
|
|
45
30
|
const params = {
|
|
@@ -91,7 +76,9 @@ function beforeAll() {
|
|
|
91
76
|
|
|
92
77
|
function beforeEach() {
|
|
93
78
|
const params = {
|
|
94
|
-
startingSyntax: (
|
|
79
|
+
startingSyntax: (
|
|
80
|
+
{ browserName, gridUrl } = { browserName: '', gridUrl: '' }
|
|
81
|
+
) => ({
|
|
95
82
|
commands: [
|
|
96
83
|
{ level: 0, statement: '[SetUp]' },
|
|
97
84
|
{ level: 0, statement: 'public void SetUp() {' },
|
|
@@ -155,7 +142,3 @@ function declareVariables() {
|
|
|
155
142
|
}
|
|
156
143
|
return params
|
|
157
144
|
}
|
|
158
|
-
|
|
159
|
-
function empty() {
|
|
160
|
-
return {}
|
|
161
|
-
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with the License. You may obtain a copy of the License at
|
|
8
|
+
//
|
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
//
|
|
11
|
+
// Unless required by applicable law or agreed to in writing,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
codeExport as exporter,
|
|
20
|
+
generateHooks,
|
|
21
|
+
LanguageEmitter,
|
|
22
|
+
LanguageEmitterOpts,
|
|
23
|
+
} from '@seleniumhq/side-code-export'
|
|
24
|
+
import emitter from './command'
|
|
25
|
+
import { location } from '@seleniumhq/code-export-csharp-commons'
|
|
26
|
+
import hooks from './hook'
|
|
27
|
+
|
|
28
|
+
// Define language options
|
|
29
|
+
export const displayName = 'C# NUnit'
|
|
30
|
+
|
|
31
|
+
export const opts: LanguageEmitterOpts = {
|
|
32
|
+
displayName,
|
|
33
|
+
name: 'csharp-nunit',
|
|
34
|
+
emitter,
|
|
35
|
+
hooks: generateHooks(hooks),
|
|
36
|
+
fileExtension: '.cs',
|
|
37
|
+
commandPrefixPadding: ' ',
|
|
38
|
+
terminatingKeyword: '}',
|
|
39
|
+
commentPrefix: '//',
|
|
40
|
+
generateFilename: (name) => {
|
|
41
|
+
return `${exporter.parsers.capitalize(
|
|
42
|
+
exporter.parsers.sanitizeName(name)
|
|
43
|
+
)}Test${opts.fileExtension}`
|
|
44
|
+
},
|
|
45
|
+
generateMethodDeclaration: (name) => {
|
|
46
|
+
return `public void ${exporter.parsers.sanitizeName(name)}() {`
|
|
47
|
+
},
|
|
48
|
+
generateTestDeclaration: (name) => {
|
|
49
|
+
return `[Test]\npublic void ${exporter.parsers.uncapitalize(
|
|
50
|
+
exporter.parsers.sanitizeName(name)
|
|
51
|
+
)}() {`
|
|
52
|
+
},
|
|
53
|
+
generateSuiteDeclaration: (name) => {
|
|
54
|
+
return `[TestFixture]\npublic class ${exporter.parsers.capitalize(
|
|
55
|
+
exporter.parsers.sanitizeName(name)
|
|
56
|
+
)}Test {`
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Create generators for dynamic string creation of primary entities (e.g., filename, methods, test, and suite)
|
|
61
|
+
|
|
62
|
+
// Emit an individual test, wrapped in a suite (using the test name as the suite name)
|
|
63
|
+
const language: LanguageEmitter = {
|
|
64
|
+
emit: {
|
|
65
|
+
test: async function emitTest({
|
|
66
|
+
test,
|
|
67
|
+
tests,
|
|
68
|
+
project,
|
|
69
|
+
enableOriginTracing,
|
|
70
|
+
beforeEachOptions,
|
|
71
|
+
enableDescriptionAsComment,
|
|
72
|
+
}) {
|
|
73
|
+
const testDeclaration = opts.generateTestDeclaration(test.name)
|
|
74
|
+
const result = await exporter.emit.test(test, tests, {
|
|
75
|
+
...opts,
|
|
76
|
+
testDeclaration,
|
|
77
|
+
enableOriginTracing,
|
|
78
|
+
enableDescriptionAsComment,
|
|
79
|
+
project,
|
|
80
|
+
})
|
|
81
|
+
const suiteName = test.name
|
|
82
|
+
const suiteDeclaration = opts.generateSuiteDeclaration(suiteName)
|
|
83
|
+
const _suite = await exporter.emit.suite(result, tests, {
|
|
84
|
+
...opts,
|
|
85
|
+
suiteDeclaration,
|
|
86
|
+
suiteName,
|
|
87
|
+
project,
|
|
88
|
+
beforeEachOptions,
|
|
89
|
+
})
|
|
90
|
+
return {
|
|
91
|
+
filename: opts.generateFilename(test.name),
|
|
92
|
+
body: exporter.emit.orderedSuite(_suite),
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
suite: async function emitSuite({
|
|
96
|
+
suite,
|
|
97
|
+
tests,
|
|
98
|
+
project,
|
|
99
|
+
enableOriginTracing,
|
|
100
|
+
beforeEachOptions,
|
|
101
|
+
enableDescriptionAsComment,
|
|
102
|
+
}) {
|
|
103
|
+
const result = await exporter.emit.testsFromSuite(tests, suite, opts, {
|
|
104
|
+
enableOriginTracing,
|
|
105
|
+
enableDescriptionAsComment,
|
|
106
|
+
generateTestDeclaration: opts.generateTestDeclaration,
|
|
107
|
+
project,
|
|
108
|
+
})
|
|
109
|
+
const suiteDeclaration = opts.generateSuiteDeclaration(suite.name)
|
|
110
|
+
const _suite = await exporter.emit.suite(result, tests, {
|
|
111
|
+
...opts,
|
|
112
|
+
suiteDeclaration,
|
|
113
|
+
suite,
|
|
114
|
+
suiteName: suite.name,
|
|
115
|
+
project,
|
|
116
|
+
beforeEachOptions,
|
|
117
|
+
})
|
|
118
|
+
return {
|
|
119
|
+
filename: opts.generateFilename(suite.name),
|
|
120
|
+
body: exporter.emit.orderedSuite(_suite),
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
locator: location.emit,
|
|
124
|
+
command: emitter.emit,
|
|
125
|
+
},
|
|
126
|
+
opts,
|
|
127
|
+
register: {
|
|
128
|
+
command: emitter.register,
|
|
129
|
+
variable: opts.hooks.declareVariables.register,
|
|
130
|
+
dependency: opts.hooks.declareDependencies.register,
|
|
131
|
+
beforeAll: opts.hooks.beforeAll.register,
|
|
132
|
+
beforeEach: opts.hooks.beforeEach.register,
|
|
133
|
+
afterEach: opts.hooks.afterEach.register,
|
|
134
|
+
afterAll: opts.hooks.afterAll.register,
|
|
135
|
+
inEachBegin: opts.hooks.inEachBegin.register,
|
|
136
|
+
inEachEnd: opts.hooks.inEachEnd.register,
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export default language
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": "./src",
|
|
5
|
+
"rootDir": "src",
|
|
6
|
+
"outDir": "dist"
|
|
7
|
+
},
|
|
8
|
+
"include": ["src/**/*.ts"],
|
|
9
|
+
"exclude": ["**/__mocks__", "**/__tests__"],
|
|
10
|
+
"references": [
|
|
11
|
+
{
|
|
12
|
+
"path": "../code-export-csharp-commons"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"path": "../side-code-export"
|
|
16
|
+
},
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.esnext.intl.d.ts","../side-code-export/dist/code-export/preprocessor.d.ts","../side-model/dist/types.d.ts","../side-model/dist/argtypes.d.ts","../side-model/dist/commands.d.ts","../side-model/dist/index.d.ts","../side-code-export/dist/code-export/hook.d.ts","../side-code-export/dist/types.d.ts","../side-code-export/dist/code-export/emit.d.ts","../side-code-export/dist/code-export/register.d.ts","../side-code-export/dist/code-export/find.d.ts","../side-code-export/dist/code-export/parsers.d.ts","../side-code-export/dist/code-export/prettify.d.ts","../side-code-export/dist/code-export/render.d.ts","../side-code-export/dist/code-export/utils.d.ts","../side-code-export/dist/code-export/index.d.ts","../side-code-export/dist/file-writer/emit-suite.d.ts","../side-code-export/dist/file-writer/emit-test.d.ts","../side-code-export/dist/file-writer/index.d.ts","../side-code-export/dist/string-escape/index.d.ts","../side-code-export/dist/project/index.d.ts","../side-code-export/dist/index.d.ts","../code-export-csharp-commons/dist/command.d.ts","../code-export-csharp-commons/dist/location.d.ts","../code-export-csharp-commons/dist/index.d.ts","./src/command.ts","./src/hook.ts","./src/index.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/assert.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/assert/strict.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/globals.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/async_hooks.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/buffer.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/child_process.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/cluster.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/console.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/constants.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/crypto.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/dgram.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/dns.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/dns/promises.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/domain.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/events.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/fs.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/fs/promises.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/http.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/http2.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/https.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/inspector.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/module.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/net.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/os.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/path.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/perf_hooks.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/process.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/punycode.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/querystring.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/readline.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/repl.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/stream.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/stream/promises.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/stream/consumers.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/stream/web.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/string_decoder.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/test.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/timers.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/timers/promises.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/tls.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/trace_events.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/tty.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/url.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/util.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/v8.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/vm.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/wasi.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/worker_threads.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/zlib.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/globals.global.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/index.d.ts","../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/index.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/cleanupsemantic.d.ts","../../node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/types.d.ts","../../node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/index.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/types.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/difflines.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/printdiffs.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/index.d.ts","../../node_modules/.pnpm/jest-matcher-utils@27.5.1/node_modules/jest-matcher-utils/build/index.d.ts","../../node_modules/.pnpm/@types+jest@27.5.2/node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"3260e3386d9535b804205bdddb5618a9a27735bd22927f48ad54363abcd23d45","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"8b79cac9f57821f27ed9a5d63e0a60148fdfab86cf2066d7d93cb0e5d6026927","ad3e6fc6281b0036180bee24a439ba1e3587b7ea8ba84e974693239638352d15","aaac729999565f9cbe5e2c821417f108f46f3c5a932a717ad366591c20eecae9","fbb0fc873377eb8fd3091e97a0b38f2ac02b27c6c613cf61ec941d72ad3c0b22","e5889c0f7db36740230d923eefb81491f8890737e4b0e1e66646c8770f96d0cb","63d1c422a82b68b6192aa80d1841ceafb0082b5537b163398b1b47e326b2f987","befbb27557bbc3f1e6b7c5deaca66b7d72bceb1ef332b1b1c41db4d9d81ff210","ea35db4d108bae9db024d853d39cc13716b04a06d95e69af666e7b261161c583","bd6a04ab3fc64eaae736955cd48ef52bfd94a11a0ef7694d451c79cb7c0f9130","60d861eaab9db1a35eb7d43829e59d493140124bfeeeac64298029552a660c6f","a5aa779662dc7e323f1c6c5924e654943cf619aafd0473303a47617bd9477554","52f824e4551b88ec365088441bc6232cd585e0b13b2e1f4b17aaa135c1e5b81d","4826631255bbd4e40b7a72fe15ad379276a2e37d4cb6dfb454e01d5df6cde82d","d073344f1c91f1b5a8fe503e26450c279a96b80285a0a45add61064c5940eaf6","fd6fe050df20d4405edad19550c1f9d5158c2438910e7f42a5ba9f5a132c3e94","896bec96ef1abd73556bb3d77c84ddaec7f4c5d2f5bec58804df244cf4e2762d","31ac9ce243bb9c300669b252a68fcf92fec9cdac119e480e8fbe651fef39a359","2e971399faf34ec2dd70870db2cde985b0fbe9fb4e934f23378057fbfc1afde6","cb96a8697472754b800531a598ddfe6ec0adf1a7e9004f407c3a0124b9cb2e81","e885be9b048709f26ef1263a2815849a7696a11ecbafdf2d662e7e459505be26","26d80ce722c3cadfeff780079219f53985c1830fee09448ddffd74d928f976e6","47fa19fa25a0dc34d0730ed87b93bbaaf620253bab8ba61b76a7526e13327b36","8ec0e603c5c435c586b8e058c1682687cf50a2a6cbc98765e5b3c6614dfaa070","90d2a7a7ada9bf1ce4f4a1f81b881bda9d6b4fab24a418bdeeefb7d401ebd953",{"version":"aeb331b9bf0cd5955b43e48ea638a5330d24f1e7d77a196981a5942f89ff596b","signature":"a363e535d1e53bbc976bd1135dd38509b47076f9dd0bd4f142873ca65b9c8af0"},{"version":"5d64e10590f9d5f091e48213eded55784e18843fac56d4e7015e4763cc43f141","signature":"0be51d9a199f4fd176b0db3c12a369dde9d2ec5c8be08590c1dab2a627680182"},{"version":"7a719feeca3b7637231f936200f82b36f0abcb428321044513f10c21aa92c439","signature":"464db5f664585b2d6bba1d98e100376228a154db7002375799cc1c06b07b4168"},"0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"2f6c9750131d5d2fdaba85c164a930dc07d2d7e7e8970b89d32864aa6c72620c","affectsGlobalScope":true},"56d13f223ab40f71840795f5bef2552a397a70666ee60878222407f3893fb8d0",{"version":"aeeee3998c5a730f8689f04038d41cf4245c9edbf6ef29a698e45b36e399b8ed","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","3a0c45fe95e8f0e2c5247d48acf3a522d2ef29f1ab0effb3c59a9c4fdd5edbcd","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","c993aac3b6d4a4620ef9651497069eb84806a131420e4f158ea9396fb8eb9b8c","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","06ccebc2c2db57d6bdbca63b71c4ae5e6ddc42d972fd8f122d4c1a28aa111b25",{"version":"81e8508d1e82278f5d3fee936f267e00c308af36219bfcee2631f9513c9c4017","affectsGlobalScope":true},"413a4be7f94f631235bbc83dad36c4d15e5a2ff02bca1efdbd03636d6454631b","20c468256fd68d3ef1fa53526e76d51d6aa91711e84d72c0343589b99238287e","a5f6d22760eef0178bebc5b5b5664a403109615a9c49da879ccd84438bd55223","8d4c16a26d59e3ce49741a7d4a6e8206b884e226cf308667c7778a0b2c0fee7f","ee3bad055a79f188626b1a7046f04ab151fdd3581e55c51d32face175bd9d06f","d61c7c41eb1960b1285e242fd102c162b65c0522985b839fadda59874308a170",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"1dbccafbca82a60fdfb0fb3c28e2493ff76d06647a512dcf72a086022e8b6f91","d10f4929cd610c26926d6784fc3f9f4120b789c03081b5d65fb2d2670a00fa04","fb0989383c6109f20281b3d31265293daefdd76d0d30551782c1654e93704f48","a4210a84a82b3e7a8cec5b2f3616e46d523f4f10cc1576d8f2fb89d0987b341e",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","02b3239cf1b1ff8737e383ed5557f0247499d15f5bd21ab849b1a24687b6100c","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"33eee034727baf564056b4ea719075c23d3b4767d0b5f9c6933b81f3d77774d2","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637","a4471d2bdba495b2a6a30b8765d5e0282fa7009d88345a9528f73c37869d3b93",{"version":"aee7013623e7632fba449d4df1da92925b27d9b816cb05546044dbfe54c88ef4","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","c9d70d3d7191a66a81cb554557f8ed1cf736ea8397c44a864fe52689de18865a","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4",{"version":"1aad825534c73852a1f3275e527d729a2c0640f539198fdfdfeb83b839851910","affectsGlobalScope":true},"badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"e3685a8957b4e2af64c3f04a58289ee0858a649dbcd963a2b897fe85858ae18a","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","7f82ef88bdb67d9a850dd1c7cd2d690f33e0f0acd208e3c9eba086f3670d4f73",{"version":"ccfd8774cd9b929f63ff7dcf657977eb0652e3547f1fcac1b3a1dc5db22d4d58","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":8},"fileIdsList":[[114,125,130],[70,114],[73,114],[74,79,114],[75,85,86,93,102,113,114],[75,76,85,93,114],[77,114],[78,79,86,94,114],[79,102,110,114],[80,82,85,93,114],[81,114],[82,83,114],[84,85,114],[85,114],[85,86,87,102,113,114],[85,86,87,102,114],[114],[88,93,102,113,114],[85,86,88,89,93,102,110,113,114],[88,90,102,110,113,114],[70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],[85,91,114],[92,113,114],[82,85,93,102,114],[94,114],[95,114],[73,96,114],[97,112,114,118],[98,114],[99,114],[85,100,114],[100,101,114,116],[85,102,103,104,114],[102,104,114],[102,103,114],[105,114],[106,114],[85,108,109,114],[108,109,114],[79,93,110,114],[111,114],[93,112,114],[74,88,99,113,114],[79,114],[102,114,115],[114,116],[114,117],[74,79,85,87,96,102,113,114,116,118],[102,114,119],[114,123,126],[114,123,126,127,128],[114,125],[114,122,129],[114,124],[47,50,63,114],[47,63,64,65,114],[63,66,114],[63,66,67,68,114],[43,47,48,49,114],[47,114],[47,49,50,114],[43,47,48,50,51,52,53,54,55,56,63,114],[49,50,114],[49,54,114],[49,114],[47,49,114],[58,59,114],[49,57,60,61,62,114],[47,48,57,114],[45,114],[44,45,46,114],[66],[63]],"referencedMap":[[131,1],[70,2],[71,2],[73,3],[74,4],[75,5],[76,6],[77,7],[78,8],[79,9],[80,10],[81,11],[82,12],[83,12],[84,13],[85,14],[86,15],[87,16],[72,17],[120,17],[88,18],[89,19],[90,20],[121,21],[91,22],[92,23],[93,24],[94,25],[95,26],[96,27],[97,28],[98,29],[99,30],[100,31],[101,32],[102,33],[104,34],[103,35],[105,36],[106,37],[107,17],[108,38],[109,39],[110,40],[111,41],[112,42],[113,43],[114,44],[115,45],[116,46],[117,47],[118,48],[119,49],[122,17],[123,17],[127,50],[129,51],[128,50],[126,52],[130,53],[125,54],[124,17],[8,17],[9,17],[11,17],[10,17],[2,17],[12,17],[13,17],[14,17],[15,17],[16,17],[17,17],[18,17],[19,17],[3,17],[4,17],[23,17],[20,17],[21,17],[22,17],[24,17],[25,17],[26,17],[5,17],[27,17],[28,17],[29,17],[30,17],[6,17],[31,17],[32,17],[33,17],[34,17],[7,17],[35,17],[40,17],[41,17],[36,17],[37,17],[38,17],[39,17],[1,17],[42,17],[64,55],[66,56],[65,17],[67,57],[68,17],[69,58],[50,59],[52,60],[48,61],[57,62],[53,17],[43,17],[54,63],[51,63],[55,64],[56,65],[58,66],[59,66],[60,67],[63,68],[62,60],[61,17],[49,69],[45,17],[46,70],[47,71],[44,17]],"exportedModulesMap":[[131,1],[70,2],[71,2],[73,3],[74,4],[75,5],[76,6],[77,7],[78,8],[79,9],[80,10],[81,11],[82,12],[83,12],[84,13],[85,14],[86,15],[87,16],[72,17],[120,17],[88,18],[89,19],[90,20],[121,21],[91,22],[92,23],[93,24],[94,25],[95,26],[96,27],[97,28],[98,29],[99,30],[100,31],[101,32],[102,33],[104,34],[103,35],[105,36],[106,37],[107,17],[108,38],[109,39],[110,40],[111,41],[112,42],[113,43],[114,44],[115,45],[116,46],[117,47],[118,48],[119,49],[122,17],[123,17],[127,50],[129,51],[128,50],[126,52],[130,53],[125,54],[124,17],[8,17],[9,17],[11,17],[10,17],[2,17],[12,17],[13,17],[14,17],[15,17],[16,17],[17,17],[18,17],[19,17],[3,17],[4,17],[23,17],[20,17],[21,17],[22,17],[24,17],[25,17],[26,17],[5,17],[27,17],[28,17],[29,17],[30,17],[6,17],[31,17],[32,17],[33,17],[34,17],[7,17],[35,17],[40,17],[41,17],[36,17],[37,17],[38,17],[39,17],[1,17],[42,17],[64,55],[66,56],[65,17],[67,72],[69,73],[50,59],[52,60],[48,61],[57,62],[53,17],[43,17],[54,63],[51,63],[55,64],[56,65],[58,66],[59,66],[60,67],[63,68],[62,60],[61,17],[49,69],[45,17],[46,70],[47,71],[44,17]],"semanticDiagnosticsPerFile":[131,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,72,120,88,89,90,121,91,92,93,94,95,96,97,98,99,100,101,102,104,103,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,122,123,127,129,128,126,130,125,124,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,31,32,33,34,7,35,40,41,36,37,38,39,1,42,64,66,65,67,68,69,50,52,48,57,53,43,54,51,55,56,58,59,60,63,62,61,49,45,46,47,44],"latestChangedDtsFile":"./dist/index.d.ts"},"version":"4.8.4"}
|
package/.babelrc
DELETED
package/src/index.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
|
-
// or more contributor license agreements. See the NOTICE file
|
|
3
|
-
// distributed with this work for additional information
|
|
4
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
5
|
-
// to you under the Apache License, Version 2.0 (the
|
|
6
|
-
// "License"); you may not use this file except in compliance
|
|
7
|
-
// with the License. You may obtain a copy of the License at
|
|
8
|
-
//
|
|
9
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
//
|
|
11
|
-
// Unless required by applicable law or agreed to in writing,
|
|
12
|
-
// software distributed under the License is distributed on an
|
|
13
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
// KIND, either express or implied. See the License for the
|
|
15
|
-
// specific language governing permissions and limitations
|
|
16
|
-
// under the License.
|
|
17
|
-
|
|
18
|
-
import { codeExport as exporter } from '@seleniumhq/side-code-export'
|
|
19
|
-
import emitter from './command'
|
|
20
|
-
import { location } from '@seleniumhq/code-export-csharp-commons'
|
|
21
|
-
import { generateHooks } from './hook'
|
|
22
|
-
|
|
23
|
-
// Define language options
|
|
24
|
-
export const displayName = 'C# NUnit'
|
|
25
|
-
|
|
26
|
-
export let opts = {}
|
|
27
|
-
opts.emitter = emitter
|
|
28
|
-
opts.hooks = generateHooks()
|
|
29
|
-
opts.fileExtension = '.cs'
|
|
30
|
-
opts.commandPrefixPadding = ' '
|
|
31
|
-
opts.terminatingKeyword = '}'
|
|
32
|
-
opts.commentPrefix = '//'
|
|
33
|
-
opts.generateMethodDeclaration = generateMethodDeclaration
|
|
34
|
-
|
|
35
|
-
// Create generators for dynamic string creation of primary entities (e.g., filename, methods, test, and suite)
|
|
36
|
-
function generateTestDeclaration(name) {
|
|
37
|
-
return `[Test]\npublic void ${exporter.parsers.uncapitalize(
|
|
38
|
-
exporter.parsers.sanitizeName(name)
|
|
39
|
-
)}() {`
|
|
40
|
-
}
|
|
41
|
-
function generateMethodDeclaration(name) {
|
|
42
|
-
return `public void ${exporter.parsers.sanitizeName(name)}() {`
|
|
43
|
-
}
|
|
44
|
-
function generateSuiteDeclaration(name) {
|
|
45
|
-
return `[TestFixture]\npublic class ${exporter.parsers.capitalize(
|
|
46
|
-
exporter.parsers.sanitizeName(name)
|
|
47
|
-
)}Test {`
|
|
48
|
-
}
|
|
49
|
-
function generateFilename(name) {
|
|
50
|
-
return `${exporter.parsers.capitalize(
|
|
51
|
-
exporter.parsers.sanitizeName(name)
|
|
52
|
-
)}Test${opts.fileExtension}`
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Emit an individual test, wrapped in a suite (using the test name as the suite name)
|
|
56
|
-
export async function emitTest({
|
|
57
|
-
baseUrl,
|
|
58
|
-
test,
|
|
59
|
-
tests,
|
|
60
|
-
project,
|
|
61
|
-
enableOriginTracing,
|
|
62
|
-
beforeEachOptions,
|
|
63
|
-
enableDescriptionAsComment,
|
|
64
|
-
}) {
|
|
65
|
-
global.baseUrl = baseUrl
|
|
66
|
-
const testDeclaration = generateTestDeclaration(test.name)
|
|
67
|
-
const result = await exporter.emit.test(test, tests, {
|
|
68
|
-
...opts,
|
|
69
|
-
testDeclaration,
|
|
70
|
-
enableOriginTracing,
|
|
71
|
-
enableDescriptionAsComment,
|
|
72
|
-
project,
|
|
73
|
-
})
|
|
74
|
-
const suiteName = test.name
|
|
75
|
-
const suiteDeclaration = generateSuiteDeclaration(suiteName)
|
|
76
|
-
const _suite = await exporter.emit.suite(result, tests, {
|
|
77
|
-
...opts,
|
|
78
|
-
suiteDeclaration,
|
|
79
|
-
suiteName,
|
|
80
|
-
project,
|
|
81
|
-
beforeEachOptions,
|
|
82
|
-
})
|
|
83
|
-
return {
|
|
84
|
-
filename: generateFilename(test.name),
|
|
85
|
-
body: exporter.emit.orderedSuite(_suite),
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Emit a suite with all of its tests
|
|
90
|
-
export async function emitSuite({
|
|
91
|
-
baseUrl,
|
|
92
|
-
suite,
|
|
93
|
-
tests,
|
|
94
|
-
project,
|
|
95
|
-
enableOriginTracing,
|
|
96
|
-
beforeEachOptions,
|
|
97
|
-
enableDescriptionAsComment,
|
|
98
|
-
}) {
|
|
99
|
-
global.baseUrl = baseUrl
|
|
100
|
-
const result = await exporter.emit.testsFromSuite(tests, suite, opts, {
|
|
101
|
-
enableOriginTracing,
|
|
102
|
-
enableDescriptionAsComment,
|
|
103
|
-
generateTestDeclaration,
|
|
104
|
-
project,
|
|
105
|
-
})
|
|
106
|
-
const suiteDeclaration = generateSuiteDeclaration(suite.name)
|
|
107
|
-
const _suite = await exporter.emit.suite(result, tests, {
|
|
108
|
-
...opts,
|
|
109
|
-
suiteDeclaration,
|
|
110
|
-
suite,
|
|
111
|
-
project,
|
|
112
|
-
beforeEachOptions,
|
|
113
|
-
})
|
|
114
|
-
return {
|
|
115
|
-
filename: generateFilename(suite.name),
|
|
116
|
-
body: exporter.emit.orderedSuite(_suite),
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export default {
|
|
121
|
-
emit: {
|
|
122
|
-
test: emitTest,
|
|
123
|
-
suite: emitSuite,
|
|
124
|
-
locator: location.emit,
|
|
125
|
-
command: emitter.emit,
|
|
126
|
-
},
|
|
127
|
-
register: {
|
|
128
|
-
command: emitter.register,
|
|
129
|
-
variable: opts.hooks.declareVariables.register,
|
|
130
|
-
dependency: opts.hooks.declareDependencies.register,
|
|
131
|
-
beforeAll: opts.hooks.beforeAll.register,
|
|
132
|
-
beforeEach: opts.hooks.beforeEach.register,
|
|
133
|
-
afterEach: opts.hooks.afterEach.register,
|
|
134
|
-
afterAll: opts.hooks.afterAll.register,
|
|
135
|
-
inEachBegin: opts.hooks.inEachBegin.register,
|
|
136
|
-
inEachEnd: opts.hooks.inEachEnd.register,
|
|
137
|
-
},
|
|
138
|
-
}
|