Skip to content

Commit

Permalink
js dom and generator fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dtauer committed Apr 1, 2022
1 parent 87abce0 commit 86956b8
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion babel.config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["@babel/preset-env"]
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
1 change: 1 addition & 0 deletions client/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// ./client/jest.config.js
module.exports = {
testEnvironment: "jsdom",
displayName: 'client',
testEnvironmentOptions: {
url: 'https://til.test.com',
Expand Down
5 changes: 3 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
},
"babel": {
"presets": [
"react-app"
"react-app",
"@babel/preset-react"
]
},
"devDependencies": {
"jest-dom": "1.0.0",
"jest-environment-jsdom": "^27.5.1",
"jest-glamor-react": "4.2.0",
"react-scripts": "1.1.4",
"react-testing-library": "2.1.1",
Expand Down
1 change: 1 addition & 0 deletions client/src/__tests__/app.login.todo.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "regenerator-runtime/runtime";
// add a beforeEach for cleaning up state and intitializing the API

test('login as an existing user', async () => {
Expand Down
3 changes: 3 additions & 0 deletions client/src/__tests__/app.register.todo.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "regenerator-runtime/runtime";

// Hi! This is for the instructor :)
// add a beforeEach for cleaning up state and intitializing the API

Expand Down Expand Up @@ -25,3 +27,4 @@ test('register a new user', async () => {
// assert the username display is the fake user's username
// assert the logout button exists
})

1 change: 1 addition & 0 deletions client/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Home from './screens/home'
import Editor from './screens/editor'
import githubLogo from './assets/github.svg'
import twitterLogo from './assets/twitter.svg'
import "regenerator-runtime/runtime";

const Header = glamorous.div({
display: 'flex',
Expand Down
1 change: 1 addition & 0 deletions client/src/components/user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import * as api from '../utils/api'
import "regenerator-runtime/runtime";

class User extends React.Component {
initialState = {user: null, error: null, pending: false}
Expand Down
1 change: 1 addition & 0 deletions client/src/screens/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {Component} from 'react'
import * as api from '../utils/api'
import Form from '../components/form'
import {Input, TextArea} from '../components/inputs'
import "regenerator-runtime/runtime";

class Editor extends Component {
static defaultProps = {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "7.16.11",
"@babel/preset-react": "^7.16.7",
"@testing-library/cypress": "^8.0.2",
"all-contributors-cli": "6.20.0",
"as-a": "2.2.0",
Expand Down
4 changes: 3 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"loglevel": "1.6.1",
"passport": "0.4.0",
"passport-local": "1.0.0",
"regenerator-runtime": "^0.13.9",
"til-shared": "file:../shared"
},
"now": {
Expand All @@ -39,12 +40,13 @@
"@babel/preset-env"
],
"plugins": [
"transform-object-rest-spread",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime"
]
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
"@babel/register": "^7.17.7",
"babel-cli": "6.26.0",
"babel-core": "6.26.0",
Expand Down
2 changes: 2 additions & 0 deletions server/src/utils/__tests__/gist.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import axiosMock from 'axios'
import {createGist} from '../gist'
import 'regenerator-runtime/runtime';


// during instruction, create a simple inline axios mock first

Expand Down
1 change: 1 addition & 0 deletions server/src/utils/__tests__/gist.todo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// import {createGist} from '../gist'
import 'regenerator-runtime/runtime';

test('makes a request to the github API with the given data', async () => {
// const data = {
Expand Down
1 change: 1 addition & 0 deletions server/src/utils/__tests__/myjson.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axiosMock from 'axios'
import {createJSON} from '../myjson'
import 'regenerator-runtime/runtime';

beforeEach(() => {
axiosMock.post.mockClear()
Expand Down

0 comments on commit 86956b8

Please sign in to comment.