Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mplewis/rails-vue-frontend-test-example
https://github.com/mplewis/rails-vue-frontend-test-example
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mplewis/rails-vue-frontend-test-example
- Owner: mplewis
- License: mit
- Created: 2017-10-09T15:03:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T04:37:07.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T04:56:09.741Z (9 months ago)
- Language: Ruby
- Size: 314 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Frontend Testing in Rails
This example uses Rails 5.1 and [Webpacker](https://github.com/rails/webpacker) to create a working [Vue](https://github.com/vuejs/vue) frontend app.
It is configured for frontend testing with the following:
* Test runner: [Karma](https://github.com/karma-runner/karma)
* Test framework: [Mocha](https://github.com/mochajs/mocha)
* Assertions: [Chai](https://github.com/chaijs/chai)
* Mocking: [Sinon](https://github.com/sinonjs/sinon)
* Vue component testing: [avoriaz](https://github.com/eddyerburgh/avoriaz)
* Browser: [jsdom](https://github.com/tmpvar/jsdom)
* Compiler: [Webpack](https://github.com/webpack/webpack)# Usage
```sh
# Install dependencies
bundle install
yarn install# To see Vue in action, run the server, then open http://localhost:3000 in your browser
rails s# Run frontend tests in test/javascript
yarn test
```# How does it work?
Check out the commits, one by one, to see the step-by-step process of setting up a new Rails project, mounting a Vue component, and adding Karma with its config and dependencies.
# License
MIT