14
14
* limitations under the License.
15
15
*/
16
16
17
- const { runCommands, ensureReleasedAPILinks } = require ( '.' ) ;
17
+ const { runCommands, ensureTipOfTreeAPILinks } = require ( '.' ) ;
18
18
const Source = require ( '../Source' ) ;
19
19
const TestRunner = require ( '../../testrunner/' ) ;
20
20
const runner = new TestRunner ( ) ;
@@ -24,43 +24,6 @@ const {it, fit, xit} = runner.api();
24
24
const { beforeAll, beforeEach, afterAll, afterEach} = runner . api ( ) ;
25
25
const { expect} = runner . api ( ) ;
26
26
27
- describe ( 'ensureReleasedAPILinks' , function ( ) {
28
- it ( 'should work with non-release version' , function ( ) {
29
- const source = new Source ( 'doc.md' , `
30
- [API](https://github.com/microsoft/playwright/blob/v1.1.0/docs/api.md#class-page)
31
- ` ) ;
32
- const messages = ensureReleasedAPILinks ( [ source ] , '1.3.0-post' ) ;
33
- expect ( messages . length ) . toBe ( 1 ) ;
34
- expect ( messages [ 0 ] . type ) . toBe ( 'warning' ) ;
35
- expect ( messages [ 0 ] . text ) . toContain ( 'doc.md' ) ;
36
- expect ( source . text ( ) ) . toBe ( `
37
- [API](https://github.com/microsoft/playwright/blob/v1.3.0/docs/api.md#class-page)
38
- ` ) ;
39
- } ) ;
40
- it ( 'should work with release version' , function ( ) {
41
- const source = new Source ( 'doc.md' , `
42
- [API](https://github.com/microsoft/playwright/blob/v1.1.0/docs/api.md#class-page)
43
- ` ) ;
44
- const messages = ensureReleasedAPILinks ( [ source ] , '1.3.0' ) ;
45
- expect ( messages . length ) . toBe ( 1 ) ;
46
- expect ( messages [ 0 ] . type ) . toBe ( 'warning' ) ;
47
- expect ( messages [ 0 ] . text ) . toContain ( 'doc.md' ) ;
48
- expect ( source . text ( ) ) . toBe ( `
49
- [API](https://github.com/microsoft/playwright/blob/v1.3.0/docs/api.md#class-page)
50
- ` ) ;
51
- } ) ;
52
- it ( 'should keep master links intact' , function ( ) {
53
- const source = new Source ( 'doc.md' , `
54
- [API](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page)
55
- ` ) ;
56
- const messages = ensureReleasedAPILinks ( [ source ] , '1.3.0' ) ;
57
- expect ( messages . length ) . toBe ( 0 ) ;
58
- expect ( source . text ( ) ) . toBe ( `
59
- [API](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page)
60
- ` ) ;
61
- } ) ;
62
- } ) ;
63
-
64
27
describe ( 'runCommands' , function ( ) {
65
28
const OPTIONS_REL = {
66
29
libversion : '1.3.0' ,
@@ -95,7 +58,7 @@ describe('runCommands', function() {
95
58
Playwright <!-- gen:version -->v1.3.0<!-- gen:stop -->
96
59
` ) ;
97
60
} ) ;
98
- it ( 'should work for *-post versions' , function ( ) {
61
+ it ( 'should work for pre-release versions' , function ( ) {
99
62
const source = new Source ( 'doc.md' , `
100
63
Playwright <!-- gen:version -->XXX<!-- gen:stop -->
101
64
` ) ;
@@ -122,30 +85,6 @@ describe('runCommands', function() {
122
85
expect ( messages [ 0 ] . text ) . toContain ( `Failed to find 'gen:stop'` ) ;
123
86
} ) ;
124
87
} ) ;
125
- describe ( 'gen:empty-if-release' , function ( ) {
126
- it ( 'should clear text when release version' , function ( ) {
127
- const source = new Source ( 'doc.md' , `
128
- <!-- gen:empty-if-release -->XXX<!-- gen:stop -->
129
- ` ) ;
130
- const messages = runCommands ( [ source ] , OPTIONS_REL ) ;
131
- expect ( messages . length ) . toBe ( 1 ) ;
132
- expect ( messages [ 0 ] . type ) . toBe ( 'warning' ) ;
133
- expect ( messages [ 0 ] . text ) . toContain ( 'doc.md' ) ;
134
- expect ( source . text ( ) ) . toBe ( `
135
- <!-- gen:empty-if-release --><!-- gen:stop -->
136
- ` ) ;
137
- } ) ;
138
- it ( 'should keep text when non-release version' , function ( ) {
139
- const source = new Source ( 'doc.md' , `
140
- <!-- gen:empty-if-release -->XXX<!-- gen:stop -->
141
- ` ) ;
142
- const messages = runCommands ( [ source ] , OPTIONS_DEV ) ;
143
- expect ( messages . length ) . toBe ( 0 ) ;
144
- expect ( source . text ( ) ) . toBe ( `
145
- <!-- gen:empty-if-release -->XXX<!-- gen:stop -->
146
- ` ) ;
147
- } ) ;
148
- } ) ;
149
88
describe ( 'gen:toc' , function ( ) {
150
89
it ( 'should work' , ( ) => {
151
90
const source = new Source ( 'doc.md' , `<!-- gen:toc -->XXX<!-- gen:stop -->
@@ -231,7 +170,6 @@ describe('runCommands', function() {
231
170
it ( 'should work with multiple commands' , function ( ) {
232
171
const source = new Source ( 'doc.md' , `
233
172
<!-- gen:version -->xxx<!-- gen:stop -->
234
- <!-- gen:empty-if-release -->yyy<!-- gen:stop -->
235
173
<!-- gen:version -->zzz<!-- gen:stop -->
236
174
` ) ;
237
175
const messages = runCommands ( [ source ] , OPTIONS_REL ) ;
@@ -240,55 +178,34 @@ describe('runCommands', function() {
240
178
expect ( messages [ 0 ] . text ) . toContain ( 'doc.md' ) ;
241
179
expect ( source . text ( ) ) . toBe ( `
242
180
<!-- gen:version -->v1.3.0<!-- gen:stop -->
243
- <!-- gen:empty-if-release --><!-- gen:stop -->
244
181
<!-- gen:version -->v1.3.0<!-- gen:stop -->
245
182
` ) ;
246
183
} ) ;
247
- describe ( 'gen:chromium-version-if-release ' , function ( ) {
248
- it ( 'should work for release ' , function ( ) {
184
+ describe ( 'gen:chromium-version' , function ( ) {
185
+ it ( 'should work' , function ( ) {
249
186
const source = new Source ( 'doc.md' , `
250
- Playwright <!-- gen:chromium-version-if-release -->XXX<!-- gen:stop -->
187
+ Playwright <!-- gen:chromium-version -->XXX<!-- gen:stop -->
251
188
` ) ;
252
189
const messages = runCommands ( [ source ] , OPTIONS_REL ) ;
253
190
expect ( messages . length ) . toBe ( 1 ) ;
254
191
expect ( messages [ 0 ] . type ) . toBe ( 'warning' ) ;
255
192
expect ( messages [ 0 ] . text ) . toContain ( 'doc.md' ) ;
256
193
expect ( source . text ( ) ) . toBe ( `
257
- Playwright <!-- gen:chromium-version-if-release -->80.0.4004.0<!-- gen:stop -->
258
- ` ) ;
259
- } ) ;
260
- it ( 'should be noop for dev' , function ( ) {
261
- const source = new Source ( 'doc.md' , `
262
- Playwright <!-- gen:chromium-version-if-release -->XXX<!-- gen:stop -->
263
- ` ) ;
264
- const messages = runCommands ( [ source ] , OPTIONS_DEV ) ;
265
- expect ( messages . length ) . toBe ( 0 ) ;
266
- expect ( source . text ( ) ) . toBe ( `
267
- Playwright <!-- gen:chromium-version-if-release -->XXX<!-- gen:stop -->
194
+ Playwright <!-- gen:chromium-version -->80.0.4004.0<!-- gen:stop -->
268
195
` ) ;
269
196
} ) ;
270
197
} ) ;
271
198
describe ( 'gen:firefox-version' , function ( ) {
272
- it ( 'should work for release ' , function ( ) {
199
+ it ( 'should work' , function ( ) {
273
200
const source = new Source ( 'doc.md' , `
274
- Playwright <!-- gen:firefox-version-if-release -->XXX<!-- gen:stop -->
201
+ Playwright <!-- gen:firefox-version -->XXX<!-- gen:stop -->
275
202
` ) ;
276
203
const messages = runCommands ( [ source ] , OPTIONS_REL ) ;
277
204
expect ( messages . length ) . toBe ( 1 ) ;
278
205
expect ( messages [ 0 ] . type ) . toBe ( 'warning' ) ;
279
206
expect ( messages [ 0 ] . text ) . toContain ( 'doc.md' ) ;
280
207
expect ( source . text ( ) ) . toBe ( `
281
- Playwright <!-- gen:firefox-version-if-release -->73.0b3<!-- gen:stop -->
282
- ` ) ;
283
- } ) ;
284
- it ( 'should be noop for dev' , function ( ) {
285
- const source = new Source ( 'doc.md' , `
286
- Playwright <!-- gen:firefox-version-if-release -->XXX<!-- gen:stop -->
287
- ` ) ;
288
- const messages = runCommands ( [ source ] , OPTIONS_DEV ) ;
289
- expect ( messages . length ) . toBe ( 0 ) ;
290
- expect ( source . text ( ) ) . toBe ( `
291
- Playwright <!-- gen:firefox-version-if-release -->XXX<!-- gen:stop -->
208
+ Playwright <!-- gen:firefox-version -->73.0b3<!-- gen:stop -->
292
209
` ) ;
293
210
} ) ;
294
211
} ) ;
0 commit comments