Skip to content

Commit 73518b3

Browse files
committed
feat(warn): improve warning message
1 parent b74eb4f commit 73518b3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"lint": "prettier -c --parser typescript \"packages/*/{src,__tests__,e2e}/**/*.[jt]s?(x)\" \"packages/docs/**/*.[jt]s\"",
1616
"lint:fix": "pnpm run lint --write",
1717
"test": "pnpm run -r dev:prepare && pnpm run test:types && pnpm run test:vitest && pnpm run -r test && pnpm run build && pnpm run build:dts && pnpm test:dts",
18-
"test:vitest": "vitest run --coverage",
18+
"test:vitest": "vitest --coverage",
1919
"test:types": "tsc --build ./tsconfig.json",
2020
"test:dts": "pnpm run -r test:dts",
2121
"docs:api": "pnpm run --filter ./packages/docs -r docs:api"

packages/pinia/__tests__/rootState.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('Root State', () => {
1313
})
1414

1515
it('warns if creating a store without a pinia', () => {
16-
expect(() => useA()).toThrowError(/with no active Pinia/)
16+
expect(() => useA()).toThrowError(/there was no active Pinia/)
1717
})
1818

1919
it('works with no stores', () => {

packages/pinia/src/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ export function defineStore(
898898

899899
if (__DEV__ && !activePinia) {
900900
throw new Error(
901-
`[🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia?\n` +
901+
`[🍍]: "getActivePinia()" was called but there was no active Pinia. Did you forget to install pinia?\n` +
902902
`\tconst pinia = createPinia()\n` +
903903
`\tapp.use(pinia)\n` +
904904
`This will fail in production.`

0 commit comments

Comments
 (0)