This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "dotenv/config"; | |
import { GraphQLServer } from "graphql-yoga"; | |
import { resolvers, typeDefs } from './animals'; | |
import DatabaseBootstrap from './database'; | |
const server = new GraphQLServer({ typeDefs, resolvers }); | |
server.start(() => { | |
new DatabaseBootstrap().bootstrap(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoose from 'mongoose'; | |
export default class DatabaseBootstrap { | |
DBURI: string; | |
constructor() { | |
this.DBURI = process.env.DB_CONNECTION_STRING as string; | |
} | |
public async bootstrap(): Promise<void> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let animals = [ | |
{ | |
id: 0, | |
animal: 'dog', | |
emoji: '🐶' | |
}, | |
{ | |
id: 1, | |
animal: 'cat', | |
emoji: '🐱' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const animals = [ | |
{ | |
animal: 'dog', | |
emoji: '🐶' | |
}, | |
{ | |
animal: 'cat', | |
emoji: '🐱' | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GraphQLServer } from "graphql-yoga"; | |
import { resolvers, typeDefs } from './animals'; | |
const server = new GraphQLServer({ typeDefs, resolvers }); | |
server.start(() => { | |
console.log( | |
`Server is running at http://localhost:4000` | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MOCK_SERVER_PORT=3377 | |
PACT_LOCAL_BROKER=http://localhost:9292/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"test:consumer": "jest --runInBand __tests__/contract/consumer/consumer.spec.js", | |
"publish:broker": "node ./__tests__/contract/broker/publish.js", | |
"publish:pactflow": "pact-broker publish ./pacts --consumer-app-version=1.0.0 --broker-base-url=https://beyondtest.pact.dius.com.au/ --broker-token=l99xzrjHJeNUOO3MCacDDQ" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"jest": { | |
"testEnvironment": "node", | |
"transform": { | |
".(js|jsx|ts|tsx)": "@sucrase/jest-plugin" | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"test:consumer": "jest --runInBand __tests__/contract/consumer/consumer.spec.js" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"test:consumer": "jest --runInBand __tests__/contract/consumer/consumer.spec.js", | |
"publish:broker": "node ./__tests__/contract/broker/publish.js", | |
"publish:pactflow": "pact-broker publish ./pacts --consumer-app-version=1.0.0 --broker-base-url=PACTFLOW_URI --broker-token=PACTFLOW_TOKEN", | |
"up:mock-service": "./node_modules/.bin/json-server ./data/characters.json -p 3378 -w", | |
"test:provider-broker": "jest --runInBand __tests__/contract/provider/provider.spec.js --testTimeout=20000" | |
}, |