Skip to content

Commit

Permalink
build: replaced callsite-record (#7937)
Browse files Browse the repository at this point in the history
<!--
Thank you for your contribution.

Before making a PR, please read our contributing guidelines at

https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution

We recommend creating a *draft* PR, so that you can mark it as 'ready
for review' when you are done.
-->

## Purpose
_Describe the problem you want to address or the feature you want to
implement._

## Approach
_Describe how your changes address the issue or implement the desired
functionality in as much detail as possible._

## References
_Provide a link to the existing issue(s), if any._

## Pre-Merge TODO
- [ ] Write tests for your proposed changes
- [ ] Make sure that existing tests do not fail
  • Loading branch information
Aleksey28 authored Aug 14, 2023
1 parent 62ec266 commit dfa1870
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 55 deletions.
62 changes: 23 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
"@babel/preset-react": "^7.12.1",
"@babel/runtime": "^7.12.5",
"@devexpress/bin-v8-flags-filter": "^1.3.0",
"@devexpress/callsite-record": "^4.1.6",
"@types/node": "^12.20.10",
"async-exit-hook": "^1.1.2",
"babel-plugin-module-resolver": "^5.0.0",
"babel-plugin-syntax-trailing-function-commas": "^6.22.0",
"bowser": "^2.8.1",
"callsite": "^1.0.0",
"callsite-record": "^4.0.0",
"chai": "4.3.4",
"chalk": "^2.3.0",
"chrome-remote-interface": "^0.32.2",
Expand Down
2 changes: 1 addition & 1 deletion src/api/test-controller/assertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from '../../test-run/commands/assertion';
import { AssertionWithoutMethodCallError } from '../../errors/test-run';
import TestController from './index';
import { CallsiteRecord } from 'callsite-record';
import { CallsiteRecord } from '@devexpress/callsite-record';
import { AssertionOptions } from '../../test-run/commands/options';
import { isClientFunction, isSelector } from '../../client-functions/types';
import addWarning from '../../notifications/add-rendered-warning';
Expand Down
2 changes: 1 addition & 1 deletion src/api/test-controller/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TestRun from '../../test-run';
import WarningLog from '../../notifications/warning-log';
import { CommandBase } from '../../test-run/commands/base';
import { CallsiteRecord } from 'callsite-record';
import { CallsiteRecord } from '@devexpress/callsite-record';

export default class TestController {
public browser: string;
Expand Down
2 changes: 1 addition & 1 deletion src/assertions/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ExternalAssertionLibraryError, AssertionUnawaitedPromiseError } from '.
import ReExecutablePromise from '../utils/re-executable-promise';
import getFn from './get-fn';
import { AssertionCommand } from '../test-run/commands/assertion';
import { CallsiteRecord } from 'callsite-record';
import { CallsiteRecord } from '@devexpress/callsite-record';

const ASSERTION_DELAY = 200;

Expand Down
4 changes: 2 additions & 2 deletions src/errors/get-callsite.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createCallsiteRecord from 'callsite-record';
import createCallsiteRecord from '@devexpress/callsite-record';
import stackCleaningHook from './stack-cleaning-hook';
import { wrapCallSite } from 'source-map-support';

Expand All @@ -25,7 +25,7 @@ export function getCallsiteForMethod (methodName, typeName) {

export function getCallsiteForError (error, isCallsiteFrame) {
// NOTE: "source-map-support" process this kind of error automatically, cause
// in this case there is an appeal to "err.stack" inside "callsite-record" which
// in this case there is an appeal to "err.stack" inside "@devexpress/callsite-record" which
// provokes wrapping of frames, so there is no need to specify "processFrameFn".
return getCallsite({ forError: error, isCallsiteFrame });
}
2 changes: 1 addition & 1 deletion src/errors/test-run/render-error-template/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderers } from 'callsite-record';
import { renderers } from '@devexpress/callsite-record';
import { UncaughtTestCafeErrorInCustomScript } from '../../test-run';
import { shouldSkipCallsite } from '../utils';
import TEMPLATES from '../templates';
Expand Down
2 changes: 1 addition & 1 deletion src/test-run/bookmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Role, { RedirectUrl } from '../role/role';
import { DEFAULT_SPEED_VALUE } from '../configuration/default-values';
import BrowserConsoleMessages from './browser-console-messages';
import { CommandBase } from './commands/base';
import { CallsiteRecord } from 'callsite-record';
import { CallsiteRecord } from '@devexpress/callsite-record';

export default class TestRunBookmark {
private readonly testRun: TestRun;
Expand Down
2 changes: 1 addition & 1 deletion src/test-run/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ import DriverStatus from '../client/driver/status';
import { CommandBase, ActionCommandBase } from './commands/base.js';
import Role from '../role/role';
import { TestRunErrorBase } from '../shared/errors';
import { CallsiteRecord } from 'callsite-record';
import { CallsiteRecord } from '@devexpress/callsite-record';
import EventEmitter from 'events';
import getAssertionTimeout from '../utils/get-options/get-assertion-timeout';
import { AssertionCommand } from './commands/assertion';
Expand Down
2 changes: 1 addition & 1 deletion src/test-run/request/create-request-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import HTTP_HEADERS from '../../utils/http-headers';
import { RUNTIME_ERRORS } from '../../errors/types';
import { APIError } from '../../errors/runtime';
import { GetProxyUrlCommand } from '../commands/actions';
import { CallsiteRecord } from 'callsite-record';
import { CallsiteRecord } from '@devexpress/callsite-record';

const DEFAULT_ACCEPT = { [HTTP_HEADERS.accept]: `${CONTENT_TYPES.json}, ${CONTENT_TYPES.textPlain}, ${CONTENT_TYPES.all}` };
const METHODS_WITH_CONTENT_TYPE = ['POST', 'PUT', 'PATCH'];
Expand Down
2 changes: 1 addition & 1 deletion src/test-run/request/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createRequestOptions } from './create-request-options';
import { processResponseData } from './process-response-data';
import HTTP_HEADERS from '../../utils/http-headers';
import { RequestRuntimeError } from '../../errors/runtime';
import { CallsiteRecord } from 'callsite-record';
import { CallsiteRecord } from '@devexpress/callsite-record';
import { RUNTIME_ERRORS } from '../../errors/types';

import {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/get-renderes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CALLSITE_RECORD_CLASS_NAME } from '../test-run/execute-js-expression/constants';
import { CallsiteRecord, renderers as renderersRecord } from 'callsite-record';
import { CallsiteRecord, renderers as renderersRecord } from '@devexpress/callsite-record';
import { RawCommandCallsiteRecord, renderers as renderersCommand } from './raw-command-callsite-record';

type Renderers = typeof renderersRecord | typeof renderersCommand;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/prerender-callsite.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CallsiteRecord } from 'callsite-record';
import { CallsiteRecord } from '@devexpress/callsite-record';
import renderCallsiteSync from './render-callsite-sync';
import createStackFilter from '../errors/create-stack-filter';
import { RawCommandCallsiteRecord } from './raw-command-callsite-record';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/render-callsite-sync.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderers as renderersRecord } from 'callsite-record';
import { renderers as renderersRecord } from '@devexpress/callsite-record';
import { renderers as renderersCommand } from './raw-command-callsite-record';


Expand Down
4 changes: 2 additions & 2 deletions test/server/data/test-callsite/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var createCallsiteRecord = require('callsite-record');
var createCallsiteRecord = require('@devexpress/callsite-record');
var stackTrace = require('stack-chain');

var record = null;
Expand All @@ -9,7 +9,7 @@ function stackFilter (err, frames) {
.filter(function (frame) {
var filename = frame.getFileName();

return filename === __filename || filename === require.resolve('callsite-record');
return filename === __filename || filename === require.resolve('@devexpress/callsite-record');
});
}

Expand Down

0 comments on commit dfa1870

Please sign in to comment.