Skip to content

Commit

Permalink
Merge pull request #775 from kiwiupover/adding-basic-test-app
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue authored Jul 31, 2020
2 parents fd68eae + 03efc43 commit 1fd42ba
Show file tree
Hide file tree
Showing 39 changed files with 5,005 additions and 243 deletions.
50 changes: 40 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,38 @@ on:
- cron: '0 6 * * 0'

jobs:
test-mocha:
name: Mocha Tests - ${{ matrix.node-version }}
test-legacy-mocha:
name: Legacy Mocha Tests - ${{ matrix.node-version }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [12.x, 10.x]
node-version: ['10', '12']

steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: volta-cli/action@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install NPM version 4

# Remove test-packages folder so that we don't leak node_modules between apps
- name: Remove test-packages
run: |
npm config set spin false
npm install -g npm@4
rm -rf test-packages
- name: Yarn Install
run: yarn install --ignore-engines
working-directory: ./packages/ember-cli-fastboot
run: |
yarn install --ignore-engines --frozen-lockfile
- name: Run Mocha Tests
run: yarn workspace ember-cli-fastboot test:mocha
working-directory: ./packages/ember-cli-fastboot
run: |
volta install npm@4
npm --version
yarn test:mocha
test-ember:
name: Ember Tests
Expand All @@ -60,7 +69,28 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Yarn Install
run: yarn install --ignore-engines
run: yarn install --ignore-engines --frozen-lockfile
- name: Run Tests
run: yarn workspace ember-cli-fastboot test:ember


test-packages:
name: Test Packages
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [12.x, 10.x]
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Yarn Install
run: yarn install --ignore-engines --frozen-lockfile
- name: Basic App
run: yarn workspace basic-app test:mocha
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ember FastBoot

[![npm version](https://badge.fury.io/js/ember-cli-fastboot.svg)](https://badge.fury.io/js/ember-cli-fastboot)
[![Actions Status](hhttps://github.com/ember-fastboot/ember-cli-fastboot/workflows/CI/badge.svg)](https://github.com/ember-fastboot/ember-cli-fastboot/actions)
[![Actions Status](https://github.com/ember-fastboot/ember-cli-fastboot/workflows/CI/badge.svg)](https://github.com/ember-fastboot/ember-cli-fastboot/actions)

An Ember CLI addon that allows you to render and serve Ember.js apps on
the server. Using FastBoot, you can serve rendered HTML to browsers and
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"private": true,
"workspaces": [
"packages/ember-cli-fastboot"
"packages/ember-cli-fastboot",
"test-packages/basic-app"
]
}
61 changes: 0 additions & 61 deletions packages/ember-cli-fastboot/test/build-test.js

This file was deleted.

3 changes: 3 additions & 0 deletions test-packages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Test Packages App

- [Basic App](./test-packages/basic-app) This basic ember app that is fastbooted using ember-cli-fastboot. Most test will be against this basic-app. When an app needs custom ember-cli-fastboot setup another ember app should be added to the test-packages folder.
19 changes: 19 additions & 0 deletions test-packages/basic-app/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions test-packages/basic-app/.ember-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
}
20 changes: 20 additions & 0 deletions test-packages/basic-app/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
53 changes: 53 additions & 0 deletions test-packages/basic-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js',
'server/**/*.js'
],
parserOptions: {
sourceType: 'script'
},
env: {
browser: false,
node: true
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off'
}
}
]
};
25 changes: 25 additions & 0 deletions test-packages/basic-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/.env*
/.pnp*
/.sass-cache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions test-packages/basic-app/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'octane'
};
3 changes: 3 additions & 0 deletions test-packages/basic-app/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["tmp", "dist"]
}
58 changes: 58 additions & 0 deletions test-packages/basic-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# basic-app

This README outlines the details of collaborating on this Ember application.
A short introduction of this app could easily go here.

## Prerequisites

You will need the following things properly installed on your computer.

* [Git](https://git-scm.com/)
* [Node.js](https://nodejs.org/)
* [Yarn](https://yarnpkg.com/)
* [Ember CLI](https://ember-cli.com/)
* [Google Chrome](https://google.com/chrome/)

## Installation

* `git clone <repository-url>` this repository
* `cd basic-app`
* `yarn install`

## Running / Development

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).

### Code Generators

Make use of the many generators for code, try `ember help generate` for more details

### Running Tests

* `ember test`
* `ember test --server`

### Linting

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn lint:js --fix`

### Building

* `ember build` (development)
* `ember build --environment production` (production)

### Deploying

Specify what it takes to deploy your app.

## Further Reading / Useful Links

* [ember.js](https://emberjs.com/)
* [ember-cli](https://ember-cli.com/)
* Development Browser Extensions
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
12 changes: 12 additions & 0 deletions test-packages/basic-app/app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

loadInitializers(App, config.modulePrefix);
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit 1fd42ba

Please sign in to comment.