Skip to content

Commit

Permalink
Fix tests in latest release. (#4267)
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 authored Sep 18, 2024
1 parent e2e50e7 commit bc9818a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/missing-types-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ jobs:
github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Download artifact'
uses: actions/github-script@v3.1.0
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/missing-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
echo $(git diff --name-only origin/$GITHUB_BASE_REF $GITHUB_SHA types/ | tr '\n' ',') > ./pr/files_changed
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: pr
path: pr/
4 changes: 0 additions & 4 deletions test/lib/nocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ module.exports = {
},

deleteSession() {
nock('/wd/hub/session/1352110219202')
.delete()
.reply(200, {});

nock('http://localhost:10195')
.delete('/wd/hub/session/1352110219202')
.reply(204, '');
Expand Down
13 changes: 10 additions & 3 deletions test/src/runner/testRunnerTypeScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ describe('testRunnerTypeScript', function() {
let tsNode;

before(function(done) {
tsNode = require('ts-node').register();
tsNode = require('ts-node').register({
esm: false,
// Always compile and execute .ts files as CommonJS,
// even in ESM projects.
moduleTypes: {
'**/*.ts': 'cjs'
}
});

this.server = MockServer.init();
this.server.on('listening', () => {
Expand All @@ -35,8 +42,8 @@ describe('testRunnerTypeScript', function() {
this.timeout(5000);

it('testRunSimple', function() {
let testsPath = path.join(__dirname, '../../sampletests/typescript');
let globals = {
const testsPath = path.join(__dirname, '../../sampletests/typescript');
const globals = {
reporter({lastError, errmessages, modules}) {
if (lastError) {
throw lastError;
Expand Down

0 comments on commit bc9818a

Please sign in to comment.