Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
more tweaks, README
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Jun 27, 2019
1 parent 5c18b07 commit dc3ff10
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
23 changes: 19 additions & 4 deletions README.md
@@ -1,16 +1,31 @@
# realworld [![renovate-app badge][renovate-badge]][renovate-app] [![CircleCI](https://circleci.com/gh/cypress-io/cypress-example-realworld/tree/master.svg?style=svg&circle-token=f127e83138e505b26bb90ab7c0bcb60e5265fecb)](https://circleci.com/gh/cypress-io/cypress-example-realworld/tree/master)
# realworld [![renovate-app badge][renovate-badge]][renovate-app] [![CircleCI](https://circleci.com/gh/cypress-io/cypress-example-realworld/tree/master.svg?style=svg&circle-token=f127e83138e505b26bb90ab7c0bcb60e5265fecb)](https://circleci.com/gh/cypress-io/cypress-example-realworld/tree/master) [![Coverage Status](https://coveralls.io/repos/github/cypress-io/cypress-example-realworld/badge.svg?branch=master)](https://coveralls.io/github/cypress-io/cypress-example-realworld?branch=master)

Fork of [applitools/cypress-applitools-webinar](https://github.com/applitools/cypress-applitools-webinar) which is a fork of [gothinkster/realworld](https://github.com/gothinkster/realworld).

![Application](images/app.png)

## Tests

The tests are in [cypress/integration](cypress/integration) folder

- [feeds-spec.js](cypress/integration/feeds-spec.js) shows how to check the favorite articles feed and the global feed
- [follow-user-spec.js](cypress/integration/follow-user-spec.js) shows how to create two users and check if one user can follow the other
- [login-spec.js](cypress/integration/login-spec.js) checks if the user can log in via UI and via API
- [new-post-spec.js](cypress/integration/new-post-spec.js) verifies that a new article can be published and updated
- [profile-spec.js](cypress/integration/profile-spec.js) lets the user edit their profile
- [register-spec.js](cypress/integration/register-spec.js) tests if a new user can register

## Full code coverage

Is collected using [@cypress/code-coverage](https://github.com/cypress-io/code-coverage). We run locally instrumented server and client using `npm run dev:coverage`, backend coverage is exposed in [server/server/index.js](server/server/index.js) via endpoint listed in [cypress.json](cypress.json). Frontend coverage is collected by instrumenting source code on the fly, see [client/.babelrc](client/.babelrc) file.
Front- and back-end coverage for this application is collected using [@cypress/code-coverage](https://github.com/cypress-io/code-coverage). We run the locally instrumented server and client using `npm run dev:coverage`. The backend coverage is exposed in [server/server/index.js](server/server/index.js) via endpoint listed in [cypress.json](cypress.json). Frontend coverage is collected by instrumenting source code on the fly, see [client/.babelrc](client/.babelrc) file.

Combined report is saved in `coverage/index.html`
The combined report is saved in `coverage/index.html` after the test finish:

![Example full coverage report](images/full-coverage.png)

Read [Cypress code coverage guide](https://on.cypress.io/coverage)
The coverage is sent to [Coveralls.io](https://coveralls.io/repos/github/cypress-io/cypress-example-realworld) using command `npm run coveralls`.

To learn more, read the [Cypress code coverage guide](https://on.cypress.io/coverage).

[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg
[renovate-app]: https://renovateapp.com/
Binary file added images/app.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/full-coverage.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -18,6 +18,7 @@
"cypress:run": "cypress run",
"cypress:test": "cypress run -s 'cypress/integration/**/*-spec.js'",
"test": "start-test start 4100 cypress:test",
"test:coverage": "start-test start:coverage 4100 cypress:test",
"dev": "start-test start 4100 cypress:open",
"dev:coverage": "start-test start:coverage 4100 cypress:open",
"cp:sqlite3": "cp -r node_sqlite3/node-v57-darwin-x64 node_modules/sqlite3/lib/binding && cp -r node_sqlite3/node-v57-linux-x64 node_modules/sqlite3/lib/binding",
Expand Down
2 changes: 1 addition & 1 deletion server/lib/models/article.js
Expand Up @@ -106,6 +106,6 @@ module.exports = class Article extends Model {
.resultSize()

this.slug = exists ? `${slug}-${RandomString.generate(6)}` : slug
console.log('set this slug', this.slug)
// console.log('set this slug', this.slug)
}
}

0 comments on commit dc3ff10

Please sign in to comment.