Skip to content

Instantly share code, notes, and snippets.

@nikolasburk
Last active November 28, 2019 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikolasburk/047d6ab1a543c57b5f29e10ebb28ecab to your computer and use it in GitHub Desktop.
Save nikolasburk/047d6ab1a543c57b5f29e10ebb28ecab to your computer and use it in GitHub Desktop.

Test

Challenge 1

Setup instructions:

git clone https://github.com/prisma/support-challenges
cd support-challenges/challenge-1
# Create local Postgres DB called "test1"
psql test1 < ./db/mysql1.sql
# Set `datasource` URL in Prisma schema to connect to `test1` DB
npm install
npx prisma2 dev

This should throw this error:

$ npx prisma2 dev
Error in migration engine: [2019-11-25T10:23:33Z INFO  quaint::pool] Starting a PostgreSQL pool with 9 connections.
thread 'tokio-runtime-worker-0' panicked at 'Error parsing the migration steps: Error("unknown field `name`, expected `model`", line: 1, column: 59)', src/libcore/result.rs:1165:5
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook

Challenge 2

Setup instructions:

cd ../challenge-2
# Create local Postgres DB called "test2"
psql test2 < ./db/mysql2.sql
# Set `datasource` URL in Prisma schema to connect to `test2` DB
npm install
npm run dev

This should throw this error:

$ yarn dev
yarn run v1.19.1
$ ts-node src/index.ts

/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:293
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/index.ts:1:24 - error TS2307: Cannot find module '@generated/photon'.

1 import { Photon } from '@generated/photon'
                         ~~~~~~~~~~~~~~~~~~~

    at createTSError (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:293:12)
    at reportTSError (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:297:19)
    at getOutput (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:399:34)
    at Object.compile (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:457:32)
    at Module.m._compile (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:530:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:533:12)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:822:10)
error Command failed with exit code 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment