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
{ | |
"name": "testpokereact", | |
"version": "1.0.0", | |
"description": "Test repository for PokeReact", | |
"scripts": { | |
"server": "nodemon index", | |
"client": "webpack --watch", | |
"watch": "concurrently --kill-others \"npm run client\" \"npm run server\"", | |
"test-server": "mocha 'schema/**/*.serverSpec.js'", | |
"test-integration": "mocha 'schema/**/*.integration.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
'use strict'; | |
import React from 'react'; | |
class Pokedex extends React.Component { | |
render() { | |
return ( | |
<div> | |
Hello World ! | |
</div> |
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
'use strict'; | |
import React from 'react'; | |
import { render } from 'react-dom'; | |
import Pokedex from './components/Pokedex.jsx'; | |
render(<Pokedex />, document.getElementById('app')); |
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
{ | |
"presets" : [ | |
["es2015", { "modules": false }], | |
"react" | |
] | |
} |
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
'use strict'; | |
const path = require('path'); | |
const APP_DIR = path.resolve('app'); | |
const DIST_PATH = path.resolve('dist'); | |
module.exports = { | |
entry : `${APP_DIR}/app.jsx`, | |
output : { |
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
'use strict'; | |
const request = require('request-promise'); | |
const integrationServer = require("../../utils/integrationServer"); | |
const chai = require('chai'); | |
const expect = chai.expect; | |
describe('Integration', () => { | |
let app; |
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
'use strict'; | |
const request = require('request-promise'); | |
const integrationServer = require("../../utils/integrationServer"); | |
const chai = require('chai'); | |
const expect = chai.expect; | |
describe('Pokemon integration', () => { | |
let app; |
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
'use strict'; | |
const express = require('express'); | |
const graphql = require('graphql').graphql; | |
const request = require('request-promise'); | |
const rootSchema = require('../schema/rootSchema'); | |
function start(done, appPort) { | |
const app = express(); |
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
describe('resolve', () => { | |
beforeEach(() => { | |
sandbox.stub(client, 'getPokemon'); | |
sandbox.stub(client, 'getPokemons'); | |
}); | |
afterEach(() => sandbox.restore()); | |
it('Should call getPokemons when no id provided', () => { | |
pokemon.resolve(); | |
expect(client.getPokemon).to.not.have.been.called; |
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
describe('resolve', () => { | |
beforeEach(() => { | |
sandbox.stub(client, 'getPokemon'); | |
sandbox.stub(client, 'getPokemons'); | |
}); | |
afterEach(() => sandbox.restore()); | |
}); |