1
1
import { describe , it } from "vitest" ;
2
- import { defineWorld , defineWorldWithoutNamespaces } from "./world" ;
2
+ import { defineWorld } from "./world" ;
3
3
import { attest } from "@arktype/attest" ;
4
4
import { resourceToHex } from "@latticexyz/common" ;
5
5
import {
@@ -14,6 +14,7 @@ const CODEGEN_DEFAULTS = { ...STORE_CODEGEN_DEFAULTS, ...WORLD_CODEGEN_DEFAULTS
14
14
describe ( "defineWorld" , ( ) => {
15
15
it ( "should resolve namespaced tables" , ( ) => {
16
16
const config = defineWorld ( {
17
+ // @ts -expect-error TODO: remove once namespaces support ships
17
18
namespaces : {
18
19
ExampleNamespace : {
19
20
tables : {
@@ -68,6 +69,7 @@ describe("defineWorld", () => {
68
69
69
70
it ( "should resolve namespaced table config with user types and enums" , ( ) => {
70
71
const config = defineWorld ( {
72
+ // @ts -expect-error TODO: remove once namespaces support ships
71
73
namespaces : {
72
74
ExampleNamespace : {
73
75
tables : {
@@ -134,6 +136,7 @@ describe("defineWorld", () => {
134
136
135
137
it ( "should extend the output World type" , ( ) => {
136
138
const config = defineWorld ( {
139
+ // @ts -expect-error TODO: remove once namespaces support ships
137
140
namespaces : {
138
141
ExampleNamespace : {
139
142
tables : {
@@ -163,6 +166,7 @@ describe("defineWorld", () => {
163
166
it ( "should not use the global namespace for namespaced tables" , ( ) => {
164
167
const config = defineWorld ( {
165
168
namespace : "namespace" ,
169
+ // @ts -expect-error TODO: remove once namespaces support ships
166
170
namespaces : {
167
171
AnotherOne : {
168
172
tables : {
@@ -677,16 +681,16 @@ describe("defineWorld", () => {
677
681
) . throwsAndHasTypeError ( "Overrides of `name` and `namespace` are not allowed for tables in a store config" ) ;
678
682
} ) ;
679
683
680
- it ( "should throw if name is overridden in namespaced tables" , ( ) => {
684
+ it . skip ( "should throw if name is overridden in namespaced tables" , ( ) => {
681
685
attest ( ( ) =>
682
686
defineWorld ( {
687
+ // @ts -expect-error TODO: remove once namespaces support ships
683
688
namespaces : {
684
689
MyNamespace : {
685
690
tables : {
686
691
Example : {
687
692
schema : { id : "address" } ,
688
693
key : [ "id" ] ,
689
- // @ts -expect-error "Overrides of `name` and `namespace` are not allowed for tables in a store config"
690
694
name : "NotAllowed" ,
691
695
} ,
692
696
} ,
@@ -696,16 +700,16 @@ describe("defineWorld", () => {
696
700
) . throwsAndHasTypeError ( "Overrides of `name` and `namespace` are not allowed for tables in a store config" ) ;
697
701
} ) ;
698
702
699
- it ( "should throw if namespace is overridden in namespaced tables" , ( ) => {
703
+ it . skip ( "should throw if namespace is overridden in namespaced tables" , ( ) => {
700
704
attest ( ( ) =>
701
705
defineWorld ( {
706
+ // @ts -expect-error TODO: remove once namespaces support ships
702
707
namespaces : {
703
708
MyNamespace : {
704
709
tables : {
705
710
Example : {
706
711
schema : { id : "address" } ,
707
712
key : [ "id" ] ,
708
- // @ts -expect-error "Overrides of `name` and `namespace` are not allowed for tables in a store config"
709
713
namespace : "NotAllowed" ,
710
714
} ,
711
715
} ,
@@ -714,15 +718,13 @@ describe("defineWorld", () => {
714
718
} ) ,
715
719
) . throwsAndHasTypeError ( "Overrides of `name` and `namespace` are not allowed for tables in a store config" ) ;
716
720
} ) ;
717
- } ) ;
718
721
719
- describe ( "defineWorldWithoutNamespaces" , ( ) => {
720
- it ( "should throw if namespaces are defined" , ( ) => {
722
+ it ( "should throw if namespaces are defined (TODO: remove once namespaces support ships)" , ( ) => {
721
723
attest ( ( ) =>
722
- defineWorldWithoutNamespaces ( {
723
- // @ts -expect-error Namespaces will be enabled soon
724
+ defineWorld ( {
725
+ // @ts -expect-error TODO: remove once namespaces support ships
724
726
namespaces : { } ,
725
727
} ) ,
726
- ) . type . errors ( "Namespaces will be enabled soon" ) ;
728
+ ) . type . errors ( "Namespaces config will be enabled soon. " ) ;
727
729
} ) ;
728
730
} ) ;
0 commit comments