Skip to content

Commit

Permalink
Merge 2490907 into 5fc3f48
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenezerdon committed Feb 5, 2019
2 parents 5fc3f48 + 2490907 commit 4bafa25
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "stable"
script:
- npm test
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/andela/pippin-ah-frontend.svg?branch=develop)]

# Learnground

- Learnground is an app that brings the digital experience that comes with learning to secondary school students.
Expand Down
11 changes: 11 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
setupFiles: ['<rootDir>/src/tests/setup.js'],
transform: { '^.+\\.js$': 'babel-jest' },
collectCoverageFrom: ['src/**/*.{js,jsx}'],
"snapshotSerializers": ["enzyme-to-json/serializer"],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|svg)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|scss)$': '<rootDir>/__mocks__/styleMock.js',
},
};
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"start:dev": "webpack-dev-server --config webpack/webpack.dev.js --open --hot",
"build": "webpack --config webpack/webpack.prod.js",
"serve": "node server.js",
"start": "npm run build && npm run serve"
"start": "npm run build && npm run serve",
"test": "jest --coverage --coverageReporters=text-lcov | coveralls",
"test:dev": "jest"
},
"repository": {
"type": "git",
Expand All @@ -23,7 +25,12 @@
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"babel-jest": "^24.0.0",
"babel-loader": "^8.0.5",
"coveralls": "^3.0.2",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.9.0",
"enzyme-to-json": "^3.3.5",
"eslint": "^5.13.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.0.0",
Expand All @@ -32,6 +39,7 @@
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"html-webpack-plugin": "^3.2.0",
"jest": "^24.0.0",
"prettier": "^1.16.4",
"webpack-dev-server": "^3.1.14"
},
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<title> LearnGround</title>
</head>
<body>
<div id="app">

</div>
<div id="app"></div>
</body>
</html>
11 changes: 11 additions & 0 deletions src/tests/components/LandingPage.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import { shallow } from 'enzyme';
import LandingPage from '../../components/LandingPage';

describe('LandingPage Component', () => {
it('should render the Landing Page', () => {
const component = shallow(<LandingPage />);
expect(component.exists()).toBe(true);
expect(component).toMatchSnapshot();
});
});
9 changes: 9 additions & 0 deletions src/tests/components/__snapshots__/LandingPage.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`LandingPage Component should render the Landing Page 1`] = `
<div>
<h1>
WELCOME TO LEARNGROUND
</h1>
</div>
`;
5 changes: 5 additions & 0 deletions src/tests/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

configure({ adapter: new Adapter() });
10 changes: 5 additions & 5 deletions webpack/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const common = require('./webpack.common.js');
const common = require('./webpack.common.js');

module.exports = {
...common,
mode: 'development'
};
module.exports = {
...common,
mode: 'development'
};
10 changes: 5 additions & 5 deletions webpack/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const common = require('./webpack.common.js');
const common = require('./webpack.common.js');

module.exports = {
...common,
mode: 'production',
};
module.exports = {
...common,
mode: 'production',
};

0 comments on commit 4bafa25

Please sign in to comment.