Skip to content

Commit

Permalink
chore: remove uneeded dependencies and simplify setup (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasBoll authored Jan 29, 2020
1 parent a244952 commit 44707fe
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
1 change: 0 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"baseUrl": "http://localhost:13370",
"video": false
}
6 changes: 3 additions & 3 deletions cypress/fixtures/test-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<h2>*ByLabel and *ByPlaceholder</h2>
<label for="by-text-input">Label 1</label>
<input type="text" placeholder="Input 1" id="by-text-input" />

<label for="by-text-input-2">Label 2</label>
<input type="text" placeholder="Input 2" id="by-text-input-2" />
</section>
Expand All @@ -41,7 +41,7 @@ <h3>ByText within</h3>
<section>
<h2>*ByDisplayValue</h2>
<input type="text" value="Display Value 1" />

<input type="text" value="Display Value 2" />
</section>
<section>
Expand Down Expand Up @@ -87,7 +87,7 @@ <h2>*AllByText</h2>
</section>
<section>
<h2>*ByText on another page</h2>
<a onclick='setTimeout(function() { window.location = "/next-page.html"; }, 100);'>Next Page</a>
<a onclick='setTimeout(function() { window.location = "/cypress/fixtures/test-app/next-page.html"; }, 100);'>Next Page</a>
</section>
<!-- Prettier unindents the script tag below -->
<script>
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/find.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('find* dom-testing-library commands', () => {
beforeEach(() => {
cy.visit('/')
cy.visit('cypress/fixtures/test-app/')
})

// Test each of the types of queries: LabelText, PlaceholderText, Text, DisplayValue, AltText, Title, Role, TestId
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/get.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('get* queries should error', () => {
beforeEach(() => {
cy.visit('/')
cy.visit('cypress/fixtures/test-app/')
})

const queryPrefixes = ['By', 'AllBy']
Expand All @@ -23,4 +23,4 @@ describe('get* queries should error', () => {
})
})

/* global cy */
/* global cy */
6 changes: 3 additions & 3 deletions cypress/integration/query.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('query* dom-testing-library commands', () => {
beforeEach(() => {
cy.visit('/')
cy.visit('cypress/fixtures/test-app/')
})

// Test each of the types of queries: LabelText, PlaceholderText, Text, DisplayValue, AltText, Title, Role, TestId
Expand Down Expand Up @@ -30,7 +30,7 @@ describe('query* dom-testing-library commands', () => {
.click()
.should('contain', 'Button Clicked')
})

it('queryAllByText', () => {
cy.queryAllByText(/^Button Text \d$/)
.should('have.length', 2)
Expand All @@ -44,7 +44,7 @@ describe('query* dom-testing-library commands', () => {
.clear()
.type('Some new text')
})

it('queryAllByDisplayValue', () => {
cy.queryAllByDisplayValue(/^Display Value \d$/)
.should('have.length', 2)
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
"test": "npm-run-all --parallel test:unit test:cypress",
"test:unit": "kcd-scripts test --no-watch",
"test:unit:watch": "kcd-scripts test",
"test:cypress:serve": "serve --listen 13370 ./cypress/fixtures/test-app",
"test:cypress:run": "wait-port --timeout 10000 localhost:13370 && cypress run",
"test:cypress:run": "cypress run",
"test:cypress:open": "cypress open",
"test:cypress": "npm-run-all --silent --parallel --race test:cypress:serve test:cypress:run",
"test:cypress:dev": "npm-run-all --silent --parallel --race test:cypress:serve test:cypress:open",
"test:cypress": "npm run test:cypress:run",
"test:cypress:dev": "test:cypress:open",
"validate": "kcd-scripts validate build,lint,test",
"setup": "npm install && npm run validate -s"
},
Expand Down Expand Up @@ -49,9 +48,7 @@
"devDependencies": {
"cypress": "3.4.1",
"kcd-scripts": "^1.5.2",
"npm-run-all": "^4.1.2",
"serve": "^11.1.0",
"wait-port": "^0.2.2"
"npm-run-all": "^4.1.2"
},
"peerDependencies": {
"cypress": "^2.1.0 || ^3.0.0"
Expand Down

0 comments on commit 44707fe

Please sign in to comment.