Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(ramda): Use individual imports #79

Merged
merged 1 commit into from Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -32,7 +32,7 @@
"jest-diff": "^27.4.6",
"jest-matcher-utils": "^27.4.6",
"pretty-format": "^27.3.1",
"ramda": "^0.26.1",
"ramda": "^0.28.0",
"redent": "^2.0.0"
},
"devDependencies": {
Expand Down
7 changes: 6 additions & 1 deletion src/to-be-disabled.js
@@ -1,4 +1,9 @@
import { compose, defaultTo, includes, path, propEq, anyPass } from 'ramda';
import compose from 'ramda/src/compose';
import defaultTo from 'ramda/src/defaultTo';
import includes from 'ramda/src/includes';
import path from 'ramda/src/path';
import propEq from 'ramda/src/propEq';
import anyPass from 'ramda/src/anyPass';
import { matcherHint } from 'jest-matcher-utils';

import { checkReactElement, getType, printElement } from './utils';
Expand Down
11 changes: 5 additions & 6 deletions src/to-be-empty.js
@@ -1,17 +1,16 @@
import { matcherHint } from 'jest-matcher-utils';
import { compose, defaultTo, isEmpty, not, path } from 'ramda';
import compose from 'ramda/src/compose';
import defaultTo from 'ramda/src/defaultTo';
import path from 'ramda/src/path';
import isEmpty from 'ramda/src/isEmpty';

import { checkReactElement, printElement } from './utils';

export function toBeEmpty(element) {
checkReactElement(element, toBeEmpty, this);

return {
pass: compose(
isEmpty,
defaultTo({}),
path(['props', 'children']),
)(element),
pass: compose(isEmpty, defaultTo({}), path(['props', 'children']))(element),
message: () => {
return [
matcherHint(`${this.isNot ? '.not' : ''}.toBeEmpty`, 'element', ''),
Expand Down
2 changes: 1 addition & 1 deletion src/to-contain-element.js
@@ -1,4 +1,4 @@
import { equals } from 'ramda';
import equals from 'ramda/src/equals';
import { matcherHint, RECEIVED_COLOR as receivedColor } from 'jest-matcher-utils';

import { checkReactElement, printElement } from './utils';
Expand Down
2 changes: 1 addition & 1 deletion src/to-have-prop.js
@@ -1,4 +1,4 @@
import { equals } from 'ramda';
import equals from 'ramda/src/equals';
import { matcherHint, stringify, printExpected } from 'jest-matcher-utils';
import { checkReactElement, getMessage } from './utils';

Expand Down
7 changes: 5 additions & 2 deletions src/to-have-style.js
@@ -1,8 +1,11 @@
import { matcherHint } from 'jest-matcher-utils';
import { diff } from 'jest-diff';
import chalk from 'chalk';
import { all, compose, flatten, mergeAll, toPairs } from 'ramda';

import compose from 'ramda/src/compose';
import all from 'ramda/src/all';
import flatten from 'ramda/src/flatten';
import mergeAll from 'ramda/src/mergeAll';
import toPairs from 'ramda/src/toPairs';
import { checkReactElement } from './utils';

function isSubset(expected, received) {
Expand Down
8 changes: 7 additions & 1 deletion src/to-have-text-content.js
@@ -1,5 +1,11 @@
import { matcherHint } from 'jest-matcher-utils';
import { compose, defaultTo, is, join, map, path, filter } from 'ramda';
import compose from 'ramda/src/compose';
import defaultTo from 'ramda/src/defaultTo';
import is from 'ramda/src/is';
import join from 'ramda/src/join';
import map from 'ramda/src/map';
import path from 'ramda/src/path';
import filter from 'ramda/src/filter';

import { checkReactElement, getMessage, matches, normalize } from './utils';

Expand Down