Skip to content

Commit f73714f

Browse files
committed
Hoisted module files to root level
1 parent 23908cb commit f73714f

21 files changed

+4181
-25
lines changed

.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": ["env", "react"],
3+
"plugins": [
4+
["transform-class-properties", { "spec": true }]
5+
]
6+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# See https://help.github.com/ignore-files/ for more about ignoring files.
22

33
# dependencies
4+
/node_modules
45
/demo/node_modules
56

67
# testing

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ sudo: false
33
node_js:
44
- 9.8.0
55
install:
6+
- yarn
7+
- yarn test
68
- cd demo
79
- yarn
810
script:

demo/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "react-memory-game",
2+
"name": "react-memory-game-demo",
33
"version": "0.1.16",
44
"private": false,
55
"main": "lib/index.js",
@@ -22,8 +22,8 @@
2222
},
2323
"scripts": {
2424
"start": "react-scripts start",
25-
"compile": "babel --presets es2015,stage-0,react -d lib/ src/module/",
26-
"postcompile": "cp ./src/module/*.css ./lib",
25+
"compile": "babel --presets es2015,stage-0,react -d lib/ ../src/",
26+
"postcompile": "cp ../src/*.css ./lib",
2727
"prepublish": "npm run compile",
2828
"build": "react-scripts build",
2929
"test": "react-scripts test --env=jsdom",

demo/src/module/__snapshots__/Counter.spec.jsx.snap

Lines changed: 0 additions & 15 deletions
This file was deleted.

jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
testMatch: [
3+
"<rootDir>/src/**/*.spec.js",
4+
"<rootDir>/src/**/*.spec.jsx"
5+
],
6+
setupFiles: [
7+
"<rootDir>/src/setupTests.js"
8+
],
9+
moduleNameMapper: {
10+
}
11+
};

package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "react-memory-game",
3+
"version": "1.0.0",
4+
"description": "A memory game engine.",
5+
"main": "src/index.js",
6+
"directories": {
7+
"doc": "docs"
8+
},
9+
"scripts": {
10+
"test": "jest"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/guioconnor/react-memory-game.git"
15+
},
16+
"keywords": [],
17+
"author": "",
18+
"license": "ISC",
19+
"bugs": {
20+
"url": "https://github.com/guioconnor/react-memory-game/issues"
21+
},
22+
"homepage": "https://github.com/guioconnor/react-memory-game#readme",
23+
"devDependencies": {
24+
"babel-core": "^6.26.0",
25+
"babel-jest": "^22.4.1",
26+
"babel-plugin-transform-class-properties": "^6.24.1",
27+
"babel-preset-env": "^1.6.1",
28+
"babel-preset-react": "^6.24.1",
29+
"enzyme": "^3.3.0",
30+
"enzyme-adapter-react-16": "^1.1.1",
31+
"enzyme-to-json": "^3.3.1",
32+
"jest": "^22.4.2",
33+
"jest-babel": "^1.0.1",
34+
"react": "^16.2.0",
35+
"react-dom": "^16.2.0",
36+
"regenerator-runtime": "^0.11.1"
37+
}
38+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`<Counter /> when \`counter\` is undefined should return an empty placeholder : undefinedCounter 1`] = `
4+
<div
5+
className="memory-game--counter"
6+
/>
7+
`;
8+
9+
exports[`<Counter /> when a valid \`counter is passed\` should render the passed value as a child of the counter: undefinedCounter 1`] = `
10+
<div
11+
className="memory-game--counter"
12+
>
13+
42
14+
</div>
15+
`;

demo/src/module/__snapshots__/MemoryCard.spec.jsx.snap renamed to src/__snapshots__/MemoryCard.spec.jsx.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`ClosedMemoryCard 1`] = `
3+
exports[`<MemoryCard /> when card sate is FOUND should render an found button with children inside: FoundMemoryCard 1`] = `
44
<div
55
className="memory-game--memory-slot"
66
>
77
<button
8-
className="memory-game--memory-card memory-game--memory-card__closed"
8+
className="memory-game--memory-card memory-game--memory-card__found"
99
>
1010
<CardContent>
1111
<MockChildren />
@@ -14,12 +14,12 @@ exports[`ClosedMemoryCard 1`] = `
1414
</div>
1515
`;
1616

17-
exports[`FoundMemoryCard 1`] = `
17+
exports[`<MemoryCard /> when card sate is OPEN should render an open button with children inside: OpenMemoryCard 1`] = `
1818
<div
1919
className="memory-game--memory-slot"
2020
>
2121
<button
22-
className="memory-game--memory-card memory-game--memory-card__found"
22+
className="memory-game--memory-card memory-game--memory-card__open"
2323
>
2424
<CardContent>
2525
<MockChildren />
@@ -28,12 +28,12 @@ exports[`FoundMemoryCard 1`] = `
2828
</div>
2929
`;
3030

31-
exports[`OpenMemoryCard 1`] = `
31+
exports[`<MemoryCard /> when card state is CLOSED should render a closed button with children inside: ClosedMemoryCard 1`] = `
3232
<div
3333
className="memory-game--memory-slot"
3434
>
3535
<button
36-
className="memory-game--memory-card memory-game--memory-card__open"
36+
className="memory-game--memory-card memory-game--memory-card__closed"
3737
>
3838
<CardContent>
3939
<MockChildren />

demo/src/module/__snapshots__/MemoryGrid.spec.jsx.snap renamed to src/__snapshots__/MemoryGrid.spec.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`MemoryGrid 1`] = `
3+
exports[`<MemoryGrid> should render a container with children: MemoryGrid 1`] = `
44
<div
55
className="memory-game--memory-grid"
66
/>
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/setupTests.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { configure } from 'enzyme';
2+
import Adapter from 'enzyme-adapter-react-16';
3+
4+
configure({ adapter: new Adapter() });

0 commit comments

Comments
 (0)