@@ -11,7 +11,7 @@ import {applyOperations} from '../lib/operation-handlers.js';
1111import { deepEqual , generateDiffLog } from '../lib/json-diff.js' ;
1212// @ts -expect-error Cannot find module 'virtual:integration-tests' or its corresponding type declarations.
1313import { integrationTests } from 'virtual:integration-tests' ;
14- import { getStatsHTML , setupHTML , updateHTML } from '../../util/html_generator' ;
14+ import { getStatsHTML , setupHTML , updateHTML , registerIgnoredNotRun } from '../../util/html_generator' ;
1515import { mapboxgl } from '../lib/mapboxgl.js' ;
1616import { sendFragment , sendBrowserDiagnostics } from '../lib/utils' ;
1717import { transformRequest } from '../lib/transform-request.js' ;
@@ -56,11 +56,14 @@ type TestMetadata = {
5656 name : string ;
5757 minDiff : number ;
5858 status : string ;
59+ ignoredOutcome ?: string ;
60+ color ?: string ;
5961 errors : Error [ ] ;
6062 actual ?: string ;
6163 expected ?: string ;
6264 expectedPath ?: string ;
6365 imgDiff ?: string ;
66+ error ?: Error ;
6467}
6568
6669const container = document . createElement ( 'div' ) ;
@@ -74,6 +77,8 @@ let map;
7477let reportFragment : string | undefined ;
7578
7679const getTest = ( queryTestName ) => async ( ) => {
80+ const fullTestName = `query-tests/${ queryTestName } ` ;
81+ const isTodo = ignores . todo . includes ( fullTestName ) ;
7782 let errorMessage : string | undefined ;
7883 try {
7984 const queryTest = integrationTests [ queryTestName ] ;
@@ -135,6 +140,8 @@ const getTest = (queryTestName) => async () => {
135140 const testMetaData : TestMetadata = {
136141 name : queryTestName ,
137142 actual : map . getCanvas ( ) . toDataURL ( ) ,
143+ width : options . width ,
144+ height : options . height ,
138145 minDiff : options . minDiff || 0 ,
139146 status : 'passed' ,
140147 errors : [ ]
@@ -160,6 +167,12 @@ const getTest = (queryTestName) => async () => {
160167
161168 testMetaData . status = success ? 'passed' : 'failed' ;
162169
170+ if ( isTodo ) {
171+ testMetaData . status = 'ignored' ;
172+ testMetaData . color = '#9E9E9E' ;
173+ testMetaData . ignoredOutcome = success ? 'passed' : 'failed' ;
174+ }
175+
163176 if ( import . meta. env . VITE_CI === 'false' && import . meta. env . VITE_UPDATE === 'true' ) {
164177 await server . commands . writeFile ( `${ testPath } /expected.json` , jsonDiff . replace ( '+ ' , '' ) . trim ( ) ) ;
165178 } else if ( import . meta. env . VITE_CI === 'false' ) {
@@ -171,7 +184,14 @@ const getTest = (queryTestName) => async () => {
171184
172185 if ( ! success ) errorMessage = `Query test ${ queryTestName } failed` ;
173186 } catch ( error ) {
174- reportFragment = updateHTML ( {
187+ reportFragment = updateHTML ( isTodo ? {
188+ name : queryTestName ,
189+ status : 'ignored' ,
190+ color : '#9E9E9E' ,
191+ ignoredOutcome : 'failed' ,
192+ error,
193+ errors : [ ]
194+ } : {
175195 name : queryTestName ,
176196 status : 'failed' ,
177197 error,
@@ -185,10 +205,12 @@ const getTest = (queryTestName) => async () => {
185205} ;
186206
187207const { ignores, timeout} = getEnvironmentParams ( ) ;
208+ const skippedTests : string [ ] = [ ] ;
188209
189210Object . keys ( integrationTests ) . forEach ( ( testName ) => {
190211 const queryTestName = `query-tests/${ testName } ` ;
191212 if ( ignores . skip . includes ( queryTestName ) ) {
213+ skippedTests . push ( testName ) ;
192214 test . skip ( testName , getTest ( testName ) ) ;
193215 } else if ( ignores . todo . includes ( queryTestName ) ) {
194216 test . todo ( testName , getTest ( testName ) ) ;
@@ -199,6 +221,9 @@ Object.keys(integrationTests).forEach((testName) => {
199221
200222afterAll ( async ( ) => {
201223 document . body . removeChild ( container ) ;
224+ for ( const testName of skippedTests ) {
225+ await sendFragment ( reportFragmentIdx ++ , registerIgnoredNotRun ( testName ) ) ;
226+ }
202227 await sendBrowserDiagnostics ( ) ;
203228 await sendFragment ( 0 , getStatsHTML ( ) ) ;
204229 // We cannot use `server.commands.writeFile` here because the HTML file is large
0 commit comments