Skip to content

Commit

Permalink
n71: chore: Uninstall Jest and delet it's configs
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandr-kiliushin committed Oct 23, 2022
1 parent 4cb7b9d commit 661dd30
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 32,167 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module.exports = {
env: {
browser: true,
es2021: true,
jest: true,
node: true,
},
extends: [
Expand All @@ -18,7 +17,7 @@ module.exports = {
jsx: true,
},
ecmaVersion: 13,
project: "tsconfig.eslint.json",
project: "tsconfig.json",
sourceType: "module",
tsconfigRootDir: __dirname,
},
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run check-types && npm run check-types:cypress && npm run lint-staged
npm run check-types && npm run lint-staged
File renamed without changes.
2 changes: 1 addition & 1 deletion cypress/e2e/authorization.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { testUsers } from "#utils/testing/test-users"
import { testUsers } from "#cypress/constants/test-users"

describe("Authorization", () => {
it("logs in successfully", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/budget-categories-settings.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { testUsers } from "#utils/testing/test-users"
import { testUsers } from "#cypress/constants/test-users"

describe("Budget categories settings", () => {
it("fetched and rendered correctly", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/budget-records.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { testUsers } from "#utils/testing/test-users"
import { testUsers } from "#cypress/constants/test-users"

describe("Budget records", () => {
it("are loaded correctly", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/redirect-unauthorized-users.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { testUsers } from "#utils/testing/test-users"
import { testUsers } from "#cypress/constants/test-users"

describe("redirect unauthorized users", () => {
it("unauthorized users are redirected to /auth.", () => {
Expand Down
28 changes: 25 additions & 3 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference types="cypress" />
import { getAuthToken } from "#utils/testing/getAuthToken"
import { ITestUser } from "#utils/testing/test-users"
import { ITestUser, credentialsByTestUserId } from "#cypress/constants/test-users"

// ***********************************************
// This example commands.ts shows you how to
Expand Down Expand Up @@ -50,5 +49,28 @@ declare global {
}

Cypress.Commands.add("authorize", async (testUserId) => {
localStorage.authToken = await getAuthToken(testUserId)
const testUserCredentials = credentialsByTestUserId[testUserId]
const authorizationResponse = await fetch("http://localhost:3080/graphql", {
body: JSON.stringify({
query: `
mutation CREATE_AUTHORIZATION_TOKEN {
createAuthorizationToken(input: { username: "${testUserCredentials.username}", password: "${testUserCredentials.password}" })
}
`,
}),
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
method: "POST",
})
const authorizationResponseBody = await authorizationResponse.json()
const authorizationToken = authorizationResponseBody.data.createAuthorizationToken
if (typeof authorizationToken !== "string") {
throw new Error(`
Authorization failed for the following credentials:
Username: "${testUserCredentials.username}", password: "${testUserCredentials.password}".
`)
}
localStorage.authToken = authorizationToken
})
8 changes: 0 additions & 8 deletions cypress/tsconfig.json

This file was deleted.

16 changes: 0 additions & 16 deletions jest.config.ts

This file was deleted.

21 changes: 0 additions & 21 deletions jest.setup.ts

This file was deleted.

0 comments on commit 661dd30

Please sign in to comment.