Skip to content

Commit f07b9be

Browse files
committed
updated non-null tests for buildTypeWeightTests with updated typeWeight shape
1 parent 992f236 commit f07b9be

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

test/analysis/buildTypeWeights.test.ts

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,15 +513,23 @@ describe('Test buildTypeWeightsFromSchema function', () => {
513513
human: {
514514
weight: 1,
515515
fields: {
516-
homePlanet: 0,
517-
age: 0,
518-
isHero: 0,
516+
homePlanet: {
517+
weight: 0,
518+
},
519+
age: {
520+
weight: 0,
521+
},
522+
isHero: {
523+
weight: 0,
524+
},
519525
},
520526
},
521527
droid: {
522528
weight: 1,
523529
fields: {
524-
primaryFunction: 0,
530+
primaryFunction: {
531+
weight: 0,
532+
},
525533
},
526534
},
527535
});
@@ -542,15 +550,26 @@ describe('Test buildTypeWeightsFromSchema function', () => {
542550
planet: {
543551
weight: 1,
544552
fields: {
545-
droids: expect.any(Function),
546-
heroDroids: expect.any(Function),
547-
villainDroids: expect.any(Function),
553+
droids: {
554+
resolveTo: 'droid',
555+
weight: expect.any(Function),
556+
},
557+
heroDroids: {
558+
resolveTo: 'droid',
559+
weight: expect.any(Function),
560+
},
561+
villainDroids: {
562+
resolveTo: 'droid',
563+
weight: expect.any(Function),
564+
},
548565
},
549566
},
550567
droid: {
551568
weight: 1,
552569
fields: {
553-
primaryFunction: 0,
570+
primaryFunction: {
571+
weight: 0,
572+
},
554573
},
555574
},
556575
episode: {

0 commit comments

Comments
 (0)