mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
Fix instrument tests
This commit is contained in:
parent
277e1fd7a0
commit
f179510bf8
|
@ -80,7 +80,7 @@ export const ActionCreators = {
|
||||||
stack = frames
|
stack = frames
|
||||||
.slice(
|
.slice(
|
||||||
0,
|
0,
|
||||||
traceLimit + extraFrames + (frames[0] === 'Error' ? 1 : 0)
|
traceLimit + extraFrames + (frames[0].startsWith('Error') ? 1 : 0)
|
||||||
)
|
)
|
||||||
.join('\n');
|
.join('\n');
|
||||||
}
|
}
|
||||||
|
|
|
@ -827,10 +827,9 @@ describe('instrument', () => {
|
||||||
exportedState = monitoredLiftedStore.getState();
|
exportedState = monitoredLiftedStore.getState();
|
||||||
expect(exportedState.actionsById[0].stack).toBe(undefined);
|
expect(exportedState.actionsById[0].stack).toBe(undefined);
|
||||||
expect(typeof exportedState.actionsById[1].stack).toBe('string');
|
expect(typeof exportedState.actionsById[1].stack).toBe('string');
|
||||||
expect(exportedState.actionsById[1].stack).toMatch(/\bat dispatch\b/);
|
|
||||||
expect(exportedState.actionsById[1].stack).toMatch(/\bfn1\b/);
|
expect(exportedState.actionsById[1].stack).toMatch(/\bfn1\b/);
|
||||||
expect(exportedState.actionsById[1].stack).toMatch(/\bfn2\b/);
|
expect(exportedState.actionsById[1].stack).toMatch(/\bfn2\b/);
|
||||||
expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn3\b/);
|
expect(exportedState.actionsById[1].stack).toMatch(/\bfn3\b/);
|
||||||
expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn4\b/);
|
expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn4\b/);
|
||||||
expect(exportedState.actionsById[1].stack).toContain(
|
expect(exportedState.actionsById[1].stack).toContain(
|
||||||
'instrument.spec.js'
|
'instrument.spec.js'
|
||||||
|
@ -865,10 +864,9 @@ describe('instrument', () => {
|
||||||
exportedState = monitoredLiftedStore.getState();
|
exportedState = monitoredLiftedStore.getState();
|
||||||
expect(exportedState.actionsById[0].stack).toBe(undefined);
|
expect(exportedState.actionsById[0].stack).toBe(undefined);
|
||||||
expect(typeof exportedState.actionsById[1].stack).toBe('string');
|
expect(typeof exportedState.actionsById[1].stack).toBe('string');
|
||||||
expect(exportedState.actionsById[1].stack).toMatch(/\bat dispatch\b/);
|
|
||||||
expect(exportedState.actionsById[1].stack).toMatch(/\bfn1\b/);
|
expect(exportedState.actionsById[1].stack).toMatch(/\bfn1\b/);
|
||||||
expect(exportedState.actionsById[1].stack).toMatch(/\bfn2\b/);
|
expect(exportedState.actionsById[1].stack).toMatch(/\bfn2\b/);
|
||||||
expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn3\b/);
|
expect(exportedState.actionsById[1].stack).toMatch(/\bfn3\b/);
|
||||||
expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn4\b/);
|
expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn4\b/);
|
||||||
expect(exportedState.actionsById[1].stack).toContain(
|
expect(exportedState.actionsById[1].stack).toContain(
|
||||||
'instrument.spec.js'
|
'instrument.spec.js'
|
||||||
|
@ -985,7 +983,7 @@ describe('instrument', () => {
|
||||||
exportedState = monitoredLiftedStore.getState();
|
exportedState = monitoredLiftedStore.getState();
|
||||||
expect(exportedState.actionsById[0].stack).toBe(undefined);
|
expect(exportedState.actionsById[0].stack).toBe(undefined);
|
||||||
expect(typeof exportedState.actionsById[1].stack).toBe('string');
|
expect(typeof exportedState.actionsById[1].stack).toBe('string');
|
||||||
expect(exportedState.actionsById[1].stack).toContain('at performAction');
|
expect(exportedState.actionsById[1].stack).toContain('at Object.performAction');
|
||||||
expect(exportedState.actionsById[1].stack).toContain('instrument.js');
|
expect(exportedState.actionsById[1].stack).toContain('instrument.js');
|
||||||
expect(exportedState.actionsById[1].stack).toContain(
|
expect(exportedState.actionsById[1].stack).toContain(
|
||||||
'instrument.spec.js'
|
'instrument.spec.js'
|
||||||
|
@ -1007,7 +1005,7 @@ describe('instrument', () => {
|
||||||
expect(exportedState.actionsById[0].stack).toBe(undefined);
|
expect(exportedState.actionsById[0].stack).toBe(undefined);
|
||||||
expect(typeof exportedState.actionsById[1].stack).toBe('string');
|
expect(typeof exportedState.actionsById[1].stack).toBe('string');
|
||||||
expect(exportedState.actionsById[1].stack).toContain(
|
expect(exportedState.actionsById[1].stack).toContain(
|
||||||
'at performAction'
|
'at Object.performAction'
|
||||||
);
|
);
|
||||||
expect(exportedState.actionsById[1].stack).toContain('instrument.js');
|
expect(exportedState.actionsById[1].stack).toContain('instrument.js');
|
||||||
expect(exportedState.actionsById[1].stack).toContain(
|
expect(exportedState.actionsById[1].stack).toContain(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user