Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "anyName" in store "main".`
).toHaveBeenWarnedTimes(1)
})
+
+ it('throws an error if no store id is provided', () => {
+ expect(() => defineStore({} as any)).toThrowError(
+ '[🍍]: defineStore must be passed an id string, either as its first argument or via the "id" option.'
+ )
+ })
})
} else {
options = idOrOptions
id = idOrOptions.id
+
+ if (__DEV__ && typeof id !== 'string') {
+ throw new Error(
+ `[🍍]: "defineStore()" must be passed a store id as its first argument.`
+ )
+ }
}
function useStore(pinia?: Pinia | null, hot?: StoreGeneric): StoreGeneric {