@@ -197,34 +197,33 @@ test('fail on bad labware', () => {
197
197
describe ( 'test schemas of all opentrons definitions' , ( ) => {
198
198
const labwarePaths = glob . sync ( globPattern , { cwd : definitionsDir } )
199
199
200
- beforeAll ( ( ) => {
201
- // Make sure definitions path didn't break, which would give you false positives
200
+ test ( "definition paths didn't break, which would give false positives" , ( ) => {
202
201
expect ( labwarePaths . length ) . toBeGreaterThan ( 0 )
203
202
} )
204
203
205
- labwarePaths . forEach ( labwarePath => {
204
+ describe . each ( labwarePaths ) ( '%s' , labwarePath => {
206
205
const filename = path . parse ( labwarePath ) . base
207
206
const fullLabwarePath = path . join ( definitionsDir , labwarePath )
208
207
const labwareDef = require ( fullLabwarePath ) as LabwareDefinition2
209
208
210
- it ( ` ${ filename } validates against schema` , ( ) => {
209
+ it ( ' validates against the schema' , ( ) => {
211
210
const valid = validate ( labwareDef )
212
211
const validationErrors = validate . errors
213
212
expect ( validationErrors ) . toBe ( null )
214
213
expect ( valid ) . toBe ( true )
215
214
} )
216
215
217
- it ( ` file name matches version: ${ labwarePath } ` , ( ) => {
216
+ test ( ' file name matches version' , ( ) => {
218
217
expect ( `${ labwareDef . version } ` ) . toEqual ( path . basename ( filename , '.json' ) )
219
218
} )
220
219
221
- it ( ` parent dir matches loadName: ${ labwarePath } ` , ( ) => {
220
+ test ( ' parent dir matches loadName' , ( ) => {
222
221
expect ( labwareDef . parameters . loadName ) . toEqual (
223
222
path . basename ( path . dirname ( labwarePath ) )
224
223
)
225
224
} )
226
225
227
- it ( ` namespace is "opentrons": ${ labwarePath } ` , ( ) => {
226
+ test ( ' namespace is "opentrons"' , ( ) => {
228
227
expect ( labwareDef . namespace ) . toEqual ( 'opentrons' )
229
228
} )
230
229
@@ -266,30 +265,29 @@ describe('test that the dimensions in all opentrons definitions make sense', ()
266
265
describe ( 'test schemas of all v2 labware fixtures' , ( ) => {
267
266
const labwarePaths = glob . sync ( globPattern , { cwd : fixturesDir } )
268
267
269
- beforeAll ( ( ) => {
270
- // Make sure fixtures path didn't break, which would give you false positives
268
+ test ( "definition paths didn't break, which would give false positives" , ( ) => {
271
269
expect ( labwarePaths . length ) . toBeGreaterThan ( 0 )
272
270
} )
273
271
274
- labwarePaths . forEach ( labwarePath => {
272
+ describe . each ( labwarePaths ) ( '%s' , labwarePath => {
275
273
const filename = path . parse ( labwarePath ) . base
276
274
const fullLabwarePath = path . join ( fixturesDir , labwarePath )
277
275
const labwareDef = require ( fullLabwarePath ) as LabwareDefinition2
278
276
279
- it ( `${ filename } validates against schema` , ( ) => {
277
+ test ( `${ filename } validates against schema` , ( ) => {
280
278
const valid = validate ( labwareDef )
281
279
const validationErrors = validate . errors
282
280
expect ( validationErrors ) . toBe ( null )
283
281
expect ( valid ) . toBe ( true )
284
282
} )
285
283
286
- it ( `fixture file name matches loadName: ${ labwarePath } ` , ( ) => {
284
+ test ( `fixture file name matches loadName: ${ labwarePath } ` , ( ) => {
287
285
expect ( labwareDef . parameters . loadName ) . toEqual (
288
286
path . basename ( filename , '.json' )
289
287
)
290
288
} )
291
289
292
- it ( `namespace is "fixture": ${ labwarePath } ` , ( ) => {
290
+ test ( `namespace is "fixture": ${ labwarePath } ` , ( ) => {
293
291
expect ( labwareDef . namespace ) . toEqual ( 'fixture' )
294
292
} )
295
293
0 commit comments