Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/GitHub actions #72

Merged
merged 4 commits into from Mar 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,14 @@
name: Build
on:
- pull_request

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm i
- run: npm run build
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
@@ -0,0 +1,14 @@
name: Lint
on:
- pull_request

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm i
- run: npm run lint
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,14 @@
name: Test
on:
- pull_request

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm i
- run: npm t
20 changes: 16 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -4,8 +4,9 @@
"description": "A state management for data fetches in React",
"main": "index.js",
"scripts": {
"test": "npx eslint src && jest --coverage --coverageReporters=text-lcov | coveralls",
"test": "jest",
"clean": "rimraf node_modules && npm i",
"lint": "eslint src",
"build": "node ./scripts/build.js",
"check-types": "npx tsc",
"publish": "npx jest && npx eslint src && npm run check-types && npm run build && cd build && npm publish && cd ..",
Expand Down Expand Up @@ -38,7 +39,6 @@
"@types/react": "^16.8.23",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.13.0",
"acorn": "^6.3.0",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"common-tags": "^1.8.0",
Expand All @@ -58,7 +58,7 @@
"node-fetch": "^2.6.0",
"prettier": "^1.18.2",
"react": "^16.13.0",
"react-dom": "^16.12.0",
"react-dom": "^16.13.0",
"react-redux": "^7.2.0",
"react-test-renderer": "^16.12.0",
"redux": "^4.0.5",
Expand Down
6 changes: 2 additions & 4 deletions src/useData/useData.test.js
Expand Up @@ -102,9 +102,7 @@ test('it throws if a fetch factory was passed into use error instead of a fetch'

const error = await gotError;

expect(error).toMatchInlineSnapshot(
`[Error: An error occured while selecting the store state: [useData] expected to see a fetch instance..]`,
);
expect(error).toMatchInlineSnapshot(`[Error: [useData] expected to see a fetch instance.]`);
});

test('it throws if the state is the wrong shape', async () => {
Expand Down Expand Up @@ -162,7 +160,7 @@ test('it throws if the state is the wrong shape', async () => {
const error = await gotError;

expect(error).toMatchInlineSnapshot(
`[Error: An error occured while selecting the store state: [useData] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation.]`,
`[Error: [useData] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation]`,
);
});

Expand Down
6 changes: 2 additions & 4 deletions src/useError/useError.test.js
Expand Up @@ -106,9 +106,7 @@ test('it throws if a fetch factory was passed into use error instead of a fetch'

const error = await gotError;

expect(error).toMatchInlineSnapshot(
`[Error: An error occured while selecting the store state: [useError] expected to see a fetch instance..]`,
);
expect(error).toMatchInlineSnapshot(`[Error: [useError] expected to see a fetch instance.]`);
});

test('it throws if the state is the wrong shape', async () => {
Expand Down Expand Up @@ -166,7 +164,7 @@ test('it throws if the state is the wrong shape', async () => {
const error = await gotError;

expect(error).toMatchInlineSnapshot(
`[Error: An error occured while selecting the store state: [useError] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation.]`,
`[Error: [useError] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation]`,
);
});

Expand Down