Skip to content

Commit 42130c0

Browse files
authored
Merge pull request #39 from xetxeberria/master
Tiered Pricing with TypeScript
2 parents 783e93a + 821eb58 commit 42130c0

File tree

26 files changed

+30420
-0
lines changed

26 files changed

+30420
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
extends: [
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:prettier/recommended",
6+
],
7+
plugins: ["eslint-plugin-html", "simple-import-sort", "import"],
8+
parserOptions: {
9+
ecmaVersion: 12,
10+
sourceType: "module",
11+
},
12+
rules: {
13+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
14+
"simple-import-sort/imports": "error",
15+
"simple-import-sort/exports": "error",
16+
"import/first": "error",
17+
"import/newline-after-import": "error",
18+
"import/no-duplicates": "error",
19+
},
20+
ignorePatterns: ["webpack.*.js", "cypress/**/*"],
21+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: lint
2+
3+
on: push
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Cache node modules
13+
uses: actions/cache@v2
14+
env:
15+
cache-name: cache-node-modules
16+
with:
17+
path: ~/.npm
18+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
19+
restore-keys: |
20+
${{ runner.os }}-build-${{ env.cache-name }}-
21+
${{ runner.os }}-build-
22+
${{ runner.os }}-
23+
24+
- name: Install Dependencies
25+
run: npm install
26+
27+
- name: Lint
28+
run: npm run lint
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: test
2+
3+
on: push
4+
5+
jobs:
6+
unit:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Cache node modules
13+
uses: actions/cache@v2
14+
env:
15+
cache-name: cache-node-modules
16+
with:
17+
path: ~/.npm
18+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
19+
restore-keys: |
20+
${{ runner.os }}-build-${{ env.cache-name }}-
21+
${{ runner.os }}-build-
22+
${{ runner.os }}-
23+
24+
- name: Install Dependencies
25+
run: npm install
26+
27+
- name: Test
28+
run: npm run test
29+
e2e:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
35+
- name: Cache node modules
36+
uses: actions/cache@v2
37+
env:
38+
cache-name: cache-node-modules
39+
with:
40+
path: ~/.npm
41+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
42+
restore-keys: |
43+
${{ runner.os }}-build-${{ env.cache-name }}-
44+
${{ runner.os }}-build-
45+
${{ runner.os }}-
46+
47+
- name: Install Dependencies
48+
run: npm install
49+
50+
- name: Cypress run
51+
uses: cypress-io/github-action@v2
52+
with:
53+
build: npm run build
54+
start: npm run start
55+
wait-on: "http://localhost:8080"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Dependency directories
9+
node_modules/
10+
11+
# Optional npm cache directory
12+
.npm
13+
14+
# Optional eslint cache
15+
.eslintcache
16+
17+
# Output of 'npm pack'
18+
*.tgz
19+
20+
# Yarn Integrity file
21+
.yarn-integrity
22+
23+
# dotenv environment variables file
24+
.env
25+
.env.test
26+
27+
# Build output
28+
dist
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 CodelyTV
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Tiered pricing: TypeScript
2+
3+
TypeScript codebase for [Tiered pricing](../../README.md) exercise.
4+
5+
# Testing
6+
7+
Run all tests with `npm run test`
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"useBuiltIns": "usage",
7+
"corejs": "3.9.1"
8+
}
9+
]
10+
]
11+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"baseUrl": "http://localhost:8080",
3+
"video": false
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "hello@cypress.io",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
describe("The Home Page", () => {
2+
it("successfully loads", () => {
3+
cy.visit("/");
4+
cy.findByRole("heading", { name: /hello world/i }).should("exist");
5+
});
6+
});

0 commit comments

Comments
 (0)