-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup webpack config and test env (#1)
* add webpack config * add circleci config * add repo token for coveralls * add readme
- Loading branch information
1 parent
356a925
commit d5e6b59
Showing
15 changed files
with
7,143 additions
and
155 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["react", "env"] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
working_directory: ~/WebsiteOne-FE | ||
docker: | ||
- image: circleci/node:10.15 | ||
working_directory: ~/repo | ||
- image: circleci/node:8 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- run: yarn install | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- run: yarn | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
- run: yarn test | ||
|
||
- run: | ||
name: Collect test coverage | ||
command: yarn coveralls |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
repo_token: LOlqJz40tDWAZuNO7LieRG2rPDGLWpI1D |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules/ | ||
/coverage |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ install: true | |
script: | ||
- yarn | ||
- yarn test | ||
- yarn run build | ||
- yarn build | ||
- yarn coveralls |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[](https://coveralls.io/github/AgileVentures/WebsiteOne-FE?branch=develop) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
verbose: true, | ||
collectCoverage: true, | ||
setupTestFrameworkScriptFile: "<rootDir>/src/tests/setupTests.js", | ||
coverageReporters: ["text", "lcov"], | ||
collectCoverageFrom: [ | ||
"**/*.{js,jsx}", | ||
"!**/*.{config}.{js}", | ||
"!**/node_modules/**", | ||
"!**/vendor/**", | ||
"!**/coverage/**", | ||
"!**/src/index.js" | ||
] | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
import React from "react"; | ||
|
||
export const Wink = () => <span>😉</span>; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Books By Povic</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
|
||
</head> | ||
<body> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
import React from "react"; | ||
import { render } from "react-dom"; | ||
|
||
import { Wink } from "./Wink"; | ||
|
||
render(Wink(), document.getElementById("root")); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Enzyme from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
|
||
Enzyme.configure({ adapter: new Adapter() }); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react' | ||
import {shallow} from 'enzyme'; | ||
|
||
import {Wink} from '../Wink'; | ||
|
||
|
||
describe('Wink', () => { | ||
it('should wink', () => { | ||
const component = shallow(<Wink/>) | ||
expect(component.find('span').text()).toBe("😉") | ||
}) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const HtmlWebPackPlugin = require("html-webpack-plugin"); | ||
|
||
const htmlPlugin = new HtmlWebPackPlugin({ | ||
template: "./src/index.html", | ||
filename: "./index.html" | ||
}); | ||
|
||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|jsx)$/, | ||
include: path.resolve(__dirname, "src"), | ||
use: ["babel-loader"] | ||
}, | ||
{ | ||
test: /\.(sc|sa|c)ss$/, | ||
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"] | ||
}, | ||
{ | ||
test: /\.(png|woff|woff2|eot|ttf|svg)$/, | ||
use: "url-loader?limit=100000" | ||
} | ||
] | ||
}, | ||
plugins: [htmlPlugin] | ||
}; |
Oops, something went wrong.