Skip to content

Commit fffbe88

Browse files
authored
Merge pull request #35 from CodelyTV/graduated_triangulation-with-tpp
Graduated princing solution using triangulation and TPP
2 parents c352dfb + 9234f45 commit fffbe88

File tree

26 files changed

+30458
-0
lines changed

26 files changed

+30458
-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"],
21+
};
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: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Product pricing: TypeScript
2+
3+
TypeScript [Graduated Product pricing](../../README.md) exercise solution
4+
using triangulation and TPP.
5+
6+
## Setup
7+
8+
```
9+
# install dependencies
10+
npm install
11+
```
12+
13+
## Testing
14+
15+
### Unit Testing
16+
17+
```
18+
npm run test
19+
```
20+
21+
### E2E Testing
22+
23+
```
24+
# run in dev mode on port 8080
25+
npm run dev
26+
27+
# open Cypress to run tests on dev mode
28+
npm run cy:open
29+
30+
# open Cypress on CLI
31+
npm run cy:run
32+
```
33+
34+
## Running the app
35+
36+
```
37+
# install dependencies
38+
npm install
39+
40+
# run in dev mode on port 8080
41+
npm run dev
42+
43+
# generate production build
44+
npm run build
45+
46+
# run generated content in dist folder on port 8080
47+
npm run start
48+
```
49+
50+
## Linting
51+
52+
```
53+
# run linter
54+
npm run lint
55+
56+
# fix lint issues
57+
npm run lint:fix
58+
```
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: /product pricing/i }).should("exist");
5+
});
6+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************************
3+
// This example plugins/index.js can be used to load plugins
4+
//
5+
// You can change the location of this file or turn off loading
6+
// the plugins file with the 'pluginsFile' configuration option.
7+
//
8+
// You can read more here:
9+
// https://on.cypress.io/plugins-guide
10+
// ***********************************************************
11+
12+
// This function is called when a project is opened or re-opened (e.g. due to
13+
// the project's config changing)
14+
15+
/**
16+
* @type {Cypress.PluginConfig}
17+
*/
18+
// eslint-disable-next-line no-unused-vars
19+
module.exports = (on, config) => {
20+
// `on` is used to hook into various events Cypress emits
21+
// `config` is the resolved Cypress config
22+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
//
11+
//
12+
// -- This is a parent command --
13+
// Cypress.Commands.add('login', (email, password) => { ... })
14+
//
15+
//
16+
// -- This is a child command --
17+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
18+
//
19+
//
20+
// -- This is a dual command --
21+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
22+
//
23+
//
24+
// -- This will overwrite an existing command --
25+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
26+
27+
import "@testing-library/cypress/add-commands";

0 commit comments

Comments
 (0)