Skip to content

Commit 0ac7ffc

Browse files
committed
Fix shifty legacy mode
1 parent d713df1 commit 0ac7ffc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/createTopLevelExpect.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,11 +1842,11 @@ expectPrototype._callInNestedContext = function (callback) {
18421842
}
18431843
};
18441844

1845-
expectPrototype.shifty = function (subject, args, rest) {
1845+
expectPrototype.shifty = function (subject, args, rest, legacyMode) {
18461846
this._assertWrappedExpect();
18471847

18481848
const nextArgumentType = this.findTypeOf(rest[0]);
1849-
if (arguments.length > 1) {
1849+
if (legacyMode) {
18501850
// Legacy
18511851
this.argsOutput = (output) => {
18521852
args.forEach((arg, index) => {
@@ -1912,7 +1912,7 @@ expectPrototype.shift = function (subject, assertionIndex) {
19121912
if (assertionIndex !== -1) {
19131913
const args = this.args.slice(0, assertionIndex);
19141914
const rest = this.args.slice(assertionIndex);
1915-
return this.shifty(subject, args, rest);
1915+
return this.shifty(subject, args, rest, arguments.length > 1);
19161916
} else {
19171917
// No assertion to delegate to. Provide the new subject as the fulfillment value:
19181918
return subject;

0 commit comments

Comments
 (0)