Skip to content

Commit

Permalink
Merge 70976a5 into 04d66a2
Browse files Browse the repository at this point in the history
  • Loading branch information
cdtinney committed Feb 26, 2019
2 parents 04d66a2 + 70976a5 commit da23a65
Show file tree
Hide file tree
Showing 25 changed files with 3,715 additions and 151 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pids
lib-cov

# Coverage directory used by tools like istanbul
coverage
**/coverage

# nyc test coverage
.nyc_output
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ install:
- "npm run client:build"

script:
- "npm run test"
- "npm run client:coveralls"

deploy:
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [Running](#running)
- [Stopping](#stopping)
- [Testing](#testing)
- [Server](#server)
- [Client](#client)
- [Coveralls](#coveralls)
- [Building](#building)
Expand Down Expand Up @@ -136,6 +137,20 @@ To run all tests with coverage:
$ npm run test
```

#### Server

To run server tests in watch mode:

```
$ npm run server:test
```

To run server tests with coverage:

```
$ npm run server:test:coverage
```

#### Client

To run client tests in watch mode:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ function TopAppBar(props) {
TopAppBar.propTypes = {
title: PropTypes.string.isRequired,
user: PropTypes.shape({
name: PropTypes.string.isRequired,
imageUrl: PropTypes.string.isRequired,
name: PropTypes.string,
imageUrl: PropTypes.string,
}),
classes: PropTypes.object.isRequired,
};
Expand Down
10 changes: 6 additions & 4 deletions client/src/pages/VisualizationPage/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class VisualizationPageView extends Component {
},
} = this.props;

const songPlaying = songArtistName !== undefined
&& songTitle !== undefined;
const songPlaying = songArtistName !== null
&& songTitle !== null;

return (
<div className={classes.root}>
Expand All @@ -122,8 +122,10 @@ export class VisualizationPageView extends Component {
<ColorOverlay />
<TopAppBar
title="spune"
userName={userName}
userImageUrl={userImageUrl}
user={userName && userImageUrl ? {
name: userName,
imageUrl: userImageUrl,
} : undefined}
/>
{ songPlaying &&
<div className={classes.content}>
Expand Down
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
coverageDirectory: 'server/coverage',
collectCoverageFrom: [
'server/**/*.{js}',
'!server/server.js',
'!server/coverage/**',
],
// By default, Jest runs in a JSDOM environment.
// This has issues: https://mongoosejs.com/docs/jest.html
testEnvironment: 'node',
testPathIgnorePatterns: [
'client',
],
};

0 comments on commit da23a65

Please sign in to comment.