brave-doctor-62978
12/08/2022, 3:51 PMimport { PureComponent } from 'react';
import PropTypes from 'prop-types';
import SpriteIcon from 'shared/ui/SpriteIcon';
import classnames from 'classnames';
import 'profile/styles/profile.scss';
export class PasswordCheck extends PureComponent {
static propTypes = {
ok: PropTypes.bool.isRequired,
children: PropTypes.node,
};
render() {
const className = classnames('password-check', { 'ok': this.props.ok });
return (
<div className={ className }>
<SpriteIcon
icon="checkmark"
style={ { color: this.props.ok ? '#51a33d' : null } }
/>
<span className="check-text">
{ this.props.children }
</span>
</div>
);
}
}
export default PasswordCheck;
elegant-wire-18957
12/09/2022, 3:57 PMUncaught SyntaxError: Unexpected token '<' bundle.js:1
Uncaught SyntaxError: Unexpected token '<'
The browser fires up + it tries run the tests but falls over - I suspect its something to do with the bundling but I am at a loss on how to fix it.
I have a very simple test which just visits a landing page + I have some api calls being mocked
My cypress.config.js is as below const { defineConfig } = require('cypress');
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: 'http://localhost:3000/ui',
env: {
PUBLIC_URL: '/ui',
},
video: false,
},
component: {
devServer: {
framework: 'create-react-app',
bundler: 'webpack',
},
},
});
I am using "react-scripts": "4.0.3", && "cypress": "^11.2.0",cold-cat-63632
12/09/2022, 5:00 PMbrave-doctor-62978
12/12/2022, 2:58 PMbrave-doctor-62978
12/12/2022, 2:58 PMmagnificent-finland-58048
12/12/2022, 3:08 PMelegant-wire-18957
12/12/2022, 6:45 PMcraco
and @bahmutov/cypress-code-coverage/support
- Need to build it out now to amalgamate the results with my jest output but very happy with the progress.quick-wolf-87390
12/13/2022, 4:00 PMfresh-doctor-14925
12/13/2022, 4:13 PMnutritious-analyst-96582
12/13/2022, 4:13 PMmagnificent-finland-58048
12/13/2022, 6:01 PMfresh-doctor-14925
12/13/2022, 6:03 PM!duplicate
That would be cool for a future iteration though!brave-doctor-62978
12/13/2022, 7:17 PMbrave-doctor-62978
12/13/2022, 7:17 PMcy.intercept('POST', '**/2/account', { body: {} }).as('createChildAccount');
cy.mount(<AddAccountDialog{ ...defaultProps } />, { store });
cy.get('.button-loader').should('not.exist');
cy.getByLabelText('Account Name').type('TestCo LLC');
cy.getByLabelText('Purchased Seats').type('1337');
cy.contains('button', 'Create Account')
.click();
cy.contains('button', 'Create Account').should('have.class', 'button-loader');
cy.get('@createChildAccount').its('response.status').should('be', 200);
brave-doctor-62978
12/13/2022, 7:18 PMgray-kilobyte-89541
12/13/2022, 8:03 PMcy.intercept
documentation and / or my paid network testing course https://cypress.tips/courses/network-testing (this was a lesson recently in my training advent calendar https://cypresstips.substack.com/p/cypress-training-advent-lesson-day-6ec but it already reverted to be behind the paywall)brave-doctor-62978
12/13/2022, 8:06 PMgray-kilobyte-89541
12/13/2022, 9:54 PMfresh-doctor-14925
12/14/2022, 7:28 AMbrave-doctor-62978
12/14/2022, 2:04 PMmagnificent-finland-58048
12/21/2022, 5:45 PMcreamy-angle-90546
12/28/2022, 1:59 PMmagnificent-finland-58048
12/30/2022, 1:50 PMbrave-doctor-62978
01/03/2023, 8:06 PMsass
module?brave-doctor-62978
01/03/2023, 8:06 PMmagnificent-finland-58048
01/10/2023, 3:42 PMancient-solstice-55625
01/11/2023, 5:46 AMmagnificent-finland-58048
01/11/2023, 3:28 PMbest-alligator-17841
01/17/2023, 9:48 AMcrooked-furniture-33732
01/17/2023, 10:44 AMcy.mount(<Numbers />)
, itβs not recognising <Numbers />
. On Cypress, it just throws a red error. What could I have done wrong? When I look at the video of the guy doing it, I have copied their code exactly.
/// <reference types="cypress" />
import React from 'react'
import { Numbers } from './Numbers'
describe('Numbers', () => {
it('shows numbers', () => {
cy.mount(<Numbers />)
})
})
Let me know if you need more info