Skip to content

Instantly share code, notes, and snippets.

View syntax_error_output
7 | const wrap = mount(
8 | <Foo />
> 9 | ).;
| ^
View js_blob_output.js
Chrome 71.0.3578 (Mac OS X 10.14.0) ERROR
{
"message": "Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):\nSyntaxError: Unexpected token (9:10)\n\n\u001b[0m \u001b[90m 7 | \u001b[39m \u001b[36mconst\u001b[39m wrap \u001b[33m=\u001b[39m mount(\n \u001b[90m 8 | \u001b[39m \u001b[33m<\u001b[39m\u001b[33mFoo\u001b[39m \u001b[33m/\u001b[39m\u001b[33m>\u001b[39m\n\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 9 | \u001b[39m )\u001b[33m.\u001b[39m\u001b[33m;\u001b[39m\n \u001b[90m | \u001b[39m \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\n \u001b[90m 10 | \u001b[39m \u001b[90m// console.log(wrap.find('.someCustomClass').hostNodes().debug());\u001b[39m\n \u001b[90m 11 | \u001b[39m\n \u001b[90m 12 | \u001b[39m expect(wrap\u001b[33m.\u001b[39mfind(\u001b[32m'.someCustomClass'\u001b[39m)\u001b[33m.\u001b[39mhostNodes())\u001b[33m.\u001b[39mto\u001b[33m.\u001b[39mhave\u001b[33m.\u001b[39mlength(\u001b[35m1\u001b[39m)\u001b[33m;
View host_nodes.html
<div className="someCustomClass">
<h1>
Baz is rendered
</h1>
</div>
View focused_html.html
<Bar className="someCustomClass">
<div>
<div className="barClass">
<Baz className="someCustomClass">
<div>
<div className="someCustomClass">
<h1>
Baz is rendered
</h1>
</div>
View full_output.html
<Bar className="someCustomClass">
<div>
<div className="barClass">
<Baz className="someCustomClass">
<div>
<div className="someCustomClass">
<h1>
Baz is rendered
</h1>
</div>
View only_example.js
describe.only('Something about the tests here', function () {
it('tests one thing', function () {
});
});
View basic_test.js
describe('Something about the tests here', function () {
it('tests one thing', function () {
});
});
View mount_example.html
<!-- mount() -->
<Foo>
<div>
<div className="fooClass">
<Bar>
<div>
<div className="barClass">
Something here
</div>
</div>
View shallow_example.html
<!-- shallow() -->
<div>
<div className="fooClass">
<Bar />
</div>
</div>
@ahuggins
ahuggins / EditDatasource.spec.js
Created Jan 25, 2019
Final Test with instance()
View EditDatasource.spec.js
import React from 'react';
import { render, mount, shallow } from 'enzyme';
import EditDatasource from './EditDatasource';
import { MemoryRouter } from 'react-router-dom';
describe('tests for EditDatasource', function () {
it.only('changes the datasource.type when a select button is clicked', function () {
const wrap = mount(
<MemoryRouter>
<EditDatasource