Skip to content

Commit

Permalink
TINY-11177: Removed @ephox/wrap-promise-polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpyder committed Aug 16, 2024
1 parent 9ea95a3 commit 070c20a
Show file tree
Hide file tree
Showing 21 changed files with 17 additions and 42 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Reverted TINY-10708 which was a server-side fix
- Reduced logging from client to server, and stopped waiting for log requests to complete between tests #TINY-11177

## Removed
- The Promise polyfill is no longer allowed on modern NodeJS frameworks so it has been removed. #TINY-11177

## 14.1.4 - 2024-03-27

### Fixed
Expand Down
1 change: 0 additions & 1 deletion modules/runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"dependencies": {
"@ephox/bedrock-common": "^14.1.1",
"@ephox/wrap-promise-polyfill": "^2.2.0",
"jquery": "^3.4.1",
"querystringify": "^2.1.1"
},
Expand Down
1 change: 0 additions & 1 deletion modules/runner/src/main/ts/api/Main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Failure, Global } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import * as Globals from '../core/Globals';
import * as TestLoader from '../core/TestLoader';
import { UrlParams } from '../core/UrlParams';
Expand Down
3 changes: 1 addition & 2 deletions modules/runner/src/main/ts/core/TestLoader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Promise from '@ephox/wrap-promise-polyfill';
import { ErrorCatcher } from '../errors/ErrorCatcher';

export const load = (scriptUrl: string): Promise<void> =>
Expand Down Expand Up @@ -38,4 +37,4 @@ export const load = (scriptUrl: string): Promise<void> =>

// Add the script to the dom to load it
document.body.appendChild(script);
});
});
3 changes: 1 addition & 2 deletions modules/runner/src/main/ts/core/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Suite, Test } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import sourceMappedStackTrace from 'sourcemapped-stacktrace';

// eslint-disable-next-line @typescript-eslint/no-empty-function
Expand Down Expand Up @@ -62,4 +61,4 @@ export const setStack = (error: Error, stack: string | undefined): void => {
} catch (err) {
// Do nothing
}
};
};
2 changes: 1 addition & 1 deletion modules/runner/src/main/ts/reporter/Callbacks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ErrorData, Global } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';

import { HarnessResponse } from '../core/ServerTypes';

export interface TestErrorData {
Expand Down
1 change: 0 additions & 1 deletion modules/runner/src/main/ts/reporter/Reporter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { LoggedError, Reporter as ErrorReporter } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import { Callbacks } from './Callbacks';
import { UrlParams } from '../core/UrlParams';
import { formatElapsedTime, mapStackTrace, setStack } from '../core/Utils';
Expand Down
3 changes: 1 addition & 2 deletions modules/runner/src/main/ts/runner/Hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Hook, HookType, RunnableState, Suite, Test } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import * as Context from '../core/Context';
import { SkipError } from '../errors/Errors';
import { runWithErrorCatcher, runWithTimeout } from './Run';
Expand Down Expand Up @@ -75,4 +74,4 @@ export const runAfterEach = (currentTest: Test): Promise<void> => {
} else {
return Promise.resolve();
}
};
};
3 changes: 1 addition & 2 deletions modules/runner/src/main/ts/runner/Run.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Context, ExecuteFn, Failure, Runnable, RunnableState, TestThrowable } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import { isInternalError, MultipleDone, SkipError } from '../errors/Errors';
import { ErrorCatcher } from '../errors/ErrorCatcher';
import { Timer } from './Timer';
Expand Down Expand Up @@ -128,4 +127,4 @@ export const runWithTimeout = (runnable: Runnable, context: Context, defaultTime
}).then(resolveIfNotTimedOut, reject);
});
}
};
};
3 changes: 1 addition & 2 deletions modules/runner/src/main/ts/runner/Runner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Suite } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import { HarnessResponse } from '../core/ServerTypes';
import { UrlParams } from '../core/UrlParams';
import { noop } from '../core/Utils';
Expand Down Expand Up @@ -116,4 +115,4 @@ export const Runner = (rootSuite: Suite, params: UrlParams, callbacks: Callbacks
init,
run
};
};
};
3 changes: 1 addition & 2 deletions modules/runner/src/main/ts/runner/TestRun.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Failure, LoggedError, RunnableState, Suite, Test } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import * as Context from '../core/Context';
import { InternalError, isInternalError, SkipError } from '../errors/Errors';
import { Reporter, TestReporter } from '../reporter/Reporter';
Expand Down Expand Up @@ -111,4 +110,4 @@ export const runSuite = (suite: Suite, state: RunState, actions: RunActions, rep

export const runSuites = (suites: Suite[], state: RunState, actions: RunActions, reporter: RunReporter): Promise<void> => {
return loop(suites, (suite) => runSuite(suite, state, actions, reporter));
};
};
3 changes: 1 addition & 2 deletions modules/runner/src/main/ts/runner/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Suite, Test } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';

export const countTests = (suite: Suite): number =>
suite.tests.length + suite.suites.reduce((acc, suite) => acc + countTests(suite), 0);
Expand Down Expand Up @@ -46,4 +45,4 @@ export const filterOnly = (suite: Suite): void => {
suite.suites.forEach(filterOnly);
suite.suites = onlySuites;
}
};
};
1 change: 0 additions & 1 deletion modules/runner/src/test/ts/reporter/ReporterTest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Failure, LoggedError } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import { assert } from 'chai';
import * as fc from 'fast-check';
import { beforeEach, describe, it } from 'mocha';
Expand Down
3 changes: 1 addition & 2 deletions modules/runner/src/test/ts/runner/RunnerTestUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Hook, HookType, LoggedError, Suite } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import { createHook } from '../../../main/ts/core/Hook';
import { Reporter, TestReporter } from '../../../main/ts/reporter/Reporter';
import { RunState } from '../../../main/ts/runner/TestRun';
Expand Down Expand Up @@ -63,4 +62,4 @@ export const createRunState = (offset: number, chunk: number, count = 0): RunSta
chunk,
timeout: TEST_TIMEOUT,
testCount: count
});
});
3 changes: 1 addition & 2 deletions modules/runner/src/test/ts/runner/TestRunTest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Context, HookType, RunnableState, Suite, Test } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import { assert } from 'chai';
import * as fc from 'fast-check';
import { beforeEach, describe, it } from 'mocha';
Expand Down Expand Up @@ -355,4 +354,4 @@ describe('TestRun.runSuite', () => {
assert.deepEqual(hooks, [ HookType.Before, HookType.BeforeEach, HookType.AfterEach, HookType.BeforeEach, HookType.AfterEach, HookType.After ]);
});
});
});
});
3 changes: 1 addition & 2 deletions modules/runner/src/test/ts/runner/UtilsTest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Suite } from '@ephox/bedrock-common';
import Promise from '@ephox/wrap-promise-polyfill';
import { assert } from 'chai';
import * as fc from 'fast-check';
import { describe, it } from 'mocha';
Expand Down Expand Up @@ -151,4 +150,4 @@ describe('Utils.filterOnly', () => {
assert.lengthOf(root.suites, 1);
}));
});
});
});
3 changes: 1 addition & 2 deletions modules/sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"test": "yarn test-samples-pass && yarn test-samples-only && yarn test-samples-pass-js"
},
"dependencies": {
"@ephox/bedrock-client": "^14.1.1",
"@ephox/wrap-promise-polyfill": "^2.2.1"
"@ephox/bedrock-client": "^14.1.1"
},
"devDependencies": {
"@ephox/bedrock-server": "^14.1.4"
Expand Down
1 change: 0 additions & 1 deletion modules/sample/src/test/ts/client/fail/AsyncFailTest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { UnitTest } from '@ephox/bedrock-client';
import Promise from '@ephox/wrap-promise-polyfill';

UnitTest.asyncTest('AsyncFail Test 1', (success, failure) => {
setTimeout(() => {
Expand Down
1 change: 0 additions & 1 deletion modules/sample/src/test/ts/client/pass/AsyncPassTest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { UnitTest } from '@ephox/bedrock-client';
import Promise from '@ephox/wrap-promise-polyfill';

UnitTest.asyncTest('AsyncPass Test 1', (success, _failure) => {
new Promise<void>(function (resolve, _reject) {
Expand Down
3 changes: 1 addition & 2 deletions modules/sample/src/test/ts/utils/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Promise from '@ephox/wrap-promise-polyfill';

const post = (url: string, data: Record<string, any>): Promise<void> => {
return new Promise((onSuccess, onFailure) => {
Expand Down Expand Up @@ -39,4 +38,4 @@ export {
sendKeyCombo,
sendText,
sendMouse
};
};
12 changes: 1 addition & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -987,11 +987,6 @@
resolved "https://registry.npmjs.org/@ephox/dispute/-/dispute-1.0.4.tgz"
integrity sha512-PzklC1q7Flovi/pnxTFsY1pPKaEAm0whC+lFXM2Sh4Fc+lUt7A/UMRoV9bg9DyeTbD/mWEr/hvdyJp6hI14uKg==

"@ephox/wrap-promise-polyfill@^2.2.0", "@ephox/wrap-promise-polyfill@^2.2.1":
version "2.2.1"
resolved "https://registry.npmjs.org/@ephox/wrap-promise-polyfill/-/wrap-promise-polyfill-2.2.1.tgz"
integrity sha512-hg2IKjR3E8awv6ZPUZtHVLa+ZQkaN1ksVacw40Jq2gg6uMU9GkBTcSOl+9PswBzva2Jg0lxX0r0ipMAWemDwsA==

"@eslint-community/eslint-utils@^4.2.0":
version "4.4.0"
resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz"
Expand Down Expand Up @@ -4433,12 +4428,7 @@ deepmerge-ts@^5.0.0, deepmerge-ts@^5.1.0:
resolved "https://registry.yarnpkg.com/deepmerge-ts/-/deepmerge-ts-5.1.0.tgz#c55206cc4c7be2ded89b9c816cf3608884525d7a"
integrity sha512-eS8dRJOckyo9maw9Tu5O5RUi/4inFLrnoLkBe3cPfDMx3WZioXtmOew4TXQaxq7Rhl4xjDtR7c6x8nNTxOvbFw==

deepmerge@^4.2.2:
version "4.3.1"
resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz"
integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==

deepmerge@^4.3.1:
deepmerge@^4.2.2, deepmerge@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a"
integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==
Expand Down

0 comments on commit 070c20a

Please sign in to comment.