diff --git a/tests/cli-tests/__snapshots__/prisma.test.ts.snap b/tests/cli-tests/__snapshots__/prisma.test.ts.snap deleted file mode 100644 index ce562c097de..00000000000 --- a/tests/cli-tests/__snapshots__/prisma.test.ts.snap +++ /dev/null @@ -1,72 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`keystone prisma exits with the same code as the prisma child process exits with 1`] = ` -"? GraphQL and Prisma schemas are up to date - -! Unknown command "bad-thing" - -? Prisma is a modern DB toolkit to query, migrate and model your database (https://prisma.io) - -Usage - - $ prisma [command] - -Commands - - init Set up Prisma for your app - generate Generate artifacts (e.g. Prisma Client) - db Manage your database schema and lifecycle - migrate Migrate your database - studio Browse your data with Prisma Studio - validate Validate your Prisma schema - format Format your Prisma schema - version Displays Prisma version info - debug Displays Prisma debug info - -Flags - - --preview-feature Run Preview Prisma commands - --help, -h Show additional information about a command - -Examples - - Set up a new Prisma project - $ prisma init - - Generate artifacts (e.g. Prisma Client) - $ prisma generate - - Browse your data - $ prisma studio - - Create migrations from your Prisma schema, apply them to the database, generate artifacts (e.g. Prisma Client) - $ prisma migrate dev - - Pull the schema from an existing database, updating the Prisma schema - $ prisma db pull - - Push the Prisma schema state to the database - $ prisma db push - - Validate your Prisma schema - $ prisma validate - - Format your Prisma schema - $ prisma format - - Display Prisma version info - $ prisma version - - Display Prisma debug info - $ prisma debug - -" -`; - -exports[`keystone prisma uses the db url in the keystone config 1`] = ` -"? GraphQL and Prisma schemas are up to date -Prisma schema loaded from schema.prisma -Datasource "sqlite": SQLite database "app.db" at "file:./app.db" -Error: P1003: Database app.db does not exist at ./app.db -" -`; diff --git a/tests/cli-tests/prisma.test.ts b/tests/cli-tests/prisma.test.ts index 29366bbdb57..6e41e8d9c09 100644 --- a/tests/cli-tests/prisma.test.ts +++ b/tests/cli-tests/prisma.test.ts @@ -17,10 +17,10 @@ test('keystone prisma exits with the same code as the prisma child process exits }) await spawnCommand(cwd, ['build', '--no-ui']) - const { exitCode, output } = await spawnCommand2(cwd, ['prisma', 'bad-thing']) + const { exitCode, output } = await spawnCommand2(cwd, ['prisma', 'foo']) expect(exitCode).toEqual(1) - expect(output.replace(/[^ -~\n]/g, '?').replace(/ \n/g, '\n')).toMatchSnapshot() + expect(output.replace(/[^ -~\n]/g, '?').replace(/ \n/g, '\n')).toContain(`Unknown command "foo"`) }) test('keystone prisma uses the db url in the keystone config', async () => { @@ -34,5 +34,5 @@ test('keystone prisma uses the db url in the keystone config', async () => { const { exitCode, output } = await spawnCommand2(cwd, ['prisma', 'migrate', 'status']) expect(exitCode).toEqual(1) - expect(output.replace(/[^ -~\n]/g, '?').replace(/ \n/g, '\n')).toMatchSnapshot() + expect(output.replace(/[^ -~\n]/g, '?').replace(/ \n/g, '\n')).toContain(`file:./app.db`) })