diff --git a/docs/guides/error-warning-details.md b/docs/guides/error-warning-details.md index da785dee8..3e3b86cf3 100644 --- a/docs/guides/error-warning-details.md +++ b/docs/guides/error-warning-details.md @@ -10,7 +10,7 @@ Example: ```txt Incorrect State for operation: "${gotState}", allowed States: "[${wantedStates.join(',')}]" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything ``` Details: diff --git a/packages/mongodb-memory-server-core/src/__tests__/__snapshots__/MongoMemoryReplSet.test.ts.snap b/packages/mongodb-memory-server-core/src/__tests__/__snapshots__/MongoMemoryReplSet.test.ts.snap index d8b85eb83..f35076b59 100644 --- a/packages/mongodb-memory-server-core/src/__tests__/__snapshots__/MongoMemoryReplSet.test.ts.snap +++ b/packages/mongodb-memory-server-core/src/__tests__/__snapshots__/MongoMemoryReplSet.test.ts.snap @@ -7,25 +7,25 @@ exports[`MongoMemoryReplSet getters & setters setter of "replSetOpts" should thr exports[`MongoMemoryReplSet getters & setters state errors setter of "binaryOpts" should throw an error if state is not "stopped" 1`] = ` "Incorrect State for operation: \\"init\\", allowed States: \\"[stopped]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`MongoMemoryReplSet getters & setters state errors setter of "instanceOpts" should throw an error if state is not "stopped" 1`] = ` "Incorrect State for operation: \\"init\\", allowed States: \\"[stopped]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`MongoMemoryReplSet getters & setters state errors setter of "replSetOpts" should throw an error if state is not "stopped" 1`] = ` "Incorrect State for operation: \\"init\\", allowed States: \\"[stopped]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`single server replset "_initReplSet" should throw an error if _state is not "init" 1`] = ` "Incorrect State for operation: \\"running\\", allowed States: \\"[init]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`single server replset "_initReplSet" should throw if server count is 0 or less 1`] = `"One or more servers are required."`; @@ -33,7 +33,7 @@ exports[`single server replset "_initReplSet" should throw if server count is 0 exports[`single server replset "getUri" should throw an error if _state is not "running" or "init" 1`] = ` "Incorrect State for operation: \\"stopped\\", allowed States: \\"[running,init]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`single server replset "new" should throw an error if replSet count is 0 or less 1`] = `"ReplSet Count needs to be 1 or higher! (specified count: \\"0\\")"`; @@ -41,11 +41,11 @@ exports[`single server replset "new" should throw an error if replSet count is 0 exports[`single server replset "start" should throw an error if _state is not "stopped" 1`] = ` "Incorrect State for operation: \\"running\\", allowed States: \\"[stopped]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`single server replset "waitUntilRunning" should throw an error if _state is not "init" 1`] = ` "Incorrect State for operation: \\"stopped\\", allowed States: \\"[running,init]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; diff --git a/packages/mongodb-memory-server-core/src/__tests__/__snapshots__/MongoMemoryServer.test.ts.snap b/packages/mongodb-memory-server-core/src/__tests__/__snapshots__/MongoMemoryServer.test.ts.snap index 226f6cb8e..f14216f1e 100644 --- a/packages/mongodb-memory-server-core/src/__tests__/__snapshots__/MongoMemoryServer.test.ts.snap +++ b/packages/mongodb-memory-server-core/src/__tests__/__snapshots__/MongoMemoryServer.test.ts.snap @@ -5,7 +5,7 @@ exports[`MongoMemoryServer "createAuth" should throw an error if called without exports[`MongoMemoryServer cleanup() should throw an error if state is not "stopped" 1`] = ` "Incorrect State for operation: \\"new\\", allowed States: \\"[stopped]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`MongoMemoryServer ensureInstance() should throw an error if "instanceInfo" is undefined but "_state" is "running" 1`] = `"{\\"isRunning\\":true,\\"message\\":\\"\\\\\\"ensureInstance\\\\\\" failed, because state was \\\\\\"running\\\\\\" but \\\\\\"instanceInfo\\\\\\" was undefined!\\"}"`; @@ -15,19 +15,19 @@ exports[`MongoMemoryServer ensureInstance() should throw an error if no "instanc exports[`MongoMemoryServer ensureInstance() should throw an error if the given "_state" has no case 1`] = ` "Incorrect State for operation: \\"not Existing\\", allowed States: \\"[running,new,stopped,starting]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`MongoMemoryServer getUri() should throw an state error, if not starting or running 1`] = ` "Incorrect State for operation: \\"new\\", allowed States: \\"[running,starting]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`MongoMemoryServer getUri() should throw an state error, if not starting or running 2`] = ` "Incorrect State for operation: \\"new\\", allowed States: \\"[running,starting]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`MongoMemoryServer start() "createAuth" should not be called if "disabled" is true 1`] = `"Unauthorized"`; @@ -35,11 +35,11 @@ exports[`MongoMemoryServer start() "createAuth" should not be called if "disable exports[`MongoMemoryServer start() should throw an error if state is not "new" or "stopped" 1`] = ` "Incorrect State for operation: \\"starting\\", allowed States: \\"[new,stopped]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; exports[`MongoMemoryServer start() should throw an error if state is not "new" or "stopped" 2`] = ` "Incorrect State for operation: \\"running\\", allowed States: \\"[new,stopped]\\" This may be because of using a v6.x way of calling functions, look at the following guide if anything applies: -https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" +https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything" `; diff --git a/packages/mongodb-memory-server-core/src/util/errors.ts b/packages/mongodb-memory-server-core/src/util/errors.ts index 153cc4202..1691eec14 100644 --- a/packages/mongodb-memory-server-core/src/util/errors.ts +++ b/packages/mongodb-memory-server-core/src/util/errors.ts @@ -7,7 +7,7 @@ export class StateError extends Error { ',' )}]"\n` + 'This may be because of using a v6.x way of calling functions, look at the following guide if anything applies:\n' + - 'https://nodkz.github.io/mongodb-memory-server/docs/guides/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything' + 'https://nodkz.github.io/mongodb-memory-server/docs/guides/migration/migrate7#no-function-other-than-start-create-ensureinstance-will-be-starting-anything' ); } }