Skip to content

Commit 3bb67fe

Browse files
committed
adding workflow + fixing eslint issues
1 parent 0df2632 commit 3bb67fe

File tree

4 files changed

+47
-7
lines changed

4 files changed

+47
-7
lines changed

.github/workflows/validation.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Validation
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint:
7+
name: Linting
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- name: Use Node.js 12.x
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: 12.x
15+
- name: Install dependencies
16+
run: |
17+
npm install
18+
- name: ESLint
19+
run: npm run lint
20+
21+
test:
22+
name: Run unit tests
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@master
26+
- name: Use Node.js 12.x
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: 12.x
30+
- name: Install dependencies
31+
run: npm install
32+
- name: Mocha
33+
run: npm run test --coverage
34+
- name: Coveralls
35+
uses: coverallsapp/[email protected]
36+
with:
37+
github-token: ${{ secrets.GITHUB_TOKEN }}

src/schema/__tests__/film.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ describe('Film type', async () => {
117117
edges { cursor, node { title } } }
118118
}`;
119119
const nextResult = await swapi(nextQuery);
120-
expect(nextResult.data.allFilms.edges.map(e => e.node.title)).to.deep.equal(
121-
['Return of the Jedi', 'The Phantom Menace'],
122-
);
120+
expect(
121+
nextResult.data.allFilms.edges.map(e => e.node.title),
122+
).to.deep.equal(['Return of the Jedi', 'The Phantom Menace']);
123123
});
124124
});

src/schema/__tests__/person.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ describe('Person type', async () => {
120120
edges { cursor, node { name } } }
121121
}`;
122122
const nextResult = await swapi(nextQuery);
123-
expect(nextResult.data.allPeople.edges.map(e => e.node.name)).to.deep.equal(
124-
['R2-D2', 'Darth Vader'],
125-
);
123+
expect(
124+
nextResult.data.allPeople.edges.map(e => e.node.name),
125+
).to.deep.equal(['R2-D2', 'Darth Vader']);
126126
});
127127

128128
describe('Edge cases', () => {

src/service.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ app.get('/schema', (req, res) => {
3535
app.use('/schema.graphql', express.static('./schema.graphql'));
3636

3737
// Finally, serve up the GraphQL Schema itself
38-
app.use('/', graphqlHTTP(() => ({ schema: swapiSchema })));
38+
app.use(
39+
'/',
40+
graphqlHTTP(() => ({ schema: swapiSchema })),
41+
);
3942

4043
module.exports = app;

0 commit comments

Comments
 (0)