diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82f006b8b..3bbd42e6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,11 +11,11 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - uses: actions/checkout@v3 @@ -23,7 +23,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - run: npm install --legacy-peer-deps + - run: npm i --force env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true diff --git a/package.json b/package.json index 772390a3d..fd4740e26 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "sinon": "15.2.0", "sinon-chai": "3.7.0", "testcafe": "3.0.1", - "ts-morph": "3.1.3", + "ts-morph": "19.0.0", "ts-node": "10.9.1", "tsd-jsdoc": "2.5.0", "typedoc": "0.24.8", diff --git a/test/runner/definitions_test.js b/test/runner/definitions_test.js index 170f2b499..6da8c19c7 100644 --- a/test/runner/definitions_test.js +++ b/test/runner/definitions_test.js @@ -18,7 +18,7 @@ const pathToTypings = path.resolve(pathToRootOfProject, 'typings'); chai.use(chaiSubset); describe('Definitions', function () { - this.timeout(20000); + this.timeout(30000); this.retries(4); before(() => { execSync('npm run def', { cwd: pathToRootOfProject }); @@ -39,7 +39,7 @@ describe('Definitions', function () { types.should.be.valid; const definitionsFile = types.getSourceFileOrThrow(pathOfJSDocDefinitions); - const index = definitionsFile.getNamespaceOrThrow('CodeceptJS').getNamespaceOrThrow('index').getStructure(); + const index = definitionsFile.getModule('CodeceptJS').getModule('index').getStructure(); index.statements.should.containSubset([ { declarations: [{ name: 'recorder', type: 'CodeceptJS.recorder' }] }, { declarations: [{ name: 'event', type: 'typeof CodeceptJS.event' }] }, @@ -61,7 +61,7 @@ describe('Definitions', function () { types.should.be.valid; const definitionFile = types.getSourceFileOrThrow(`${codecept_dir}/steps.d.ts`); - const extend = getExtends(definitionFile.getNamespaceOrThrow('CodeceptJS').getInterfaceOrThrow('I')); + const extend = getExtends(definitionFile.getModule('CodeceptJS').getInterfaceOrThrow('I')); extend.should.containSubset([{ methods: [{ name: 'amInPath', @@ -115,7 +115,7 @@ describe('Definitions', function () { returnType: undefined, kind: StructureKind.Method, }]); - const I = getExtends(definitionsFile.getNamespaceOrThrow('CodeceptJS').getInterfaceOrThrow('I')); + const I = getExtends(definitionsFile.getModule('CodeceptJS').getInterfaceOrThrow('I')); I.should.containSubset([{ methods: [{ name: 'openDir', @@ -184,7 +184,7 @@ describe('Definitions', function () { types.should.be.valid; const definitionsFile = types.getSourceFileOrThrow(`${codecept_dir}/steps.d.ts`); - const CallbackOrder = definitionsFile.getNamespaceOrThrow('CodeceptJS').getInterfaceOrThrow('SupportObject').getStructure(); + const CallbackOrder = definitionsFile.getModule('CodeceptJS').getInterfaceOrThrow('SupportObject').getStructure(); CallbackOrder.properties.should.containSubset([ { name: 'I', type: 'I' }, { name: 'MyPage', type: 'MyPage' }, @@ -201,7 +201,7 @@ describe('Definitions', function () { types.should.be.valid; const definitionFile = types.getSourceFileOrThrow(`${codecept_dir}/steps.d.ts`); - const extend = getExtends(definitionFile.getNamespaceOrThrow('CodeceptJS').getInterfaceOrThrow('I')); + const extend = getExtends(definitionFile.getModule('CodeceptJS').getInterfaceOrThrow('I')); extend.should.containSubset([{ methods: [{ name: 'amInPath', @@ -282,7 +282,7 @@ function typesFrom(sourceFile) { tsConfigFilePath: path.join(pathToRootOfProject, 'tsconfig.json'), resolutionHost, }); - project.addExistingSourceFile(sourceFile); + project.addSourceFileAtPath(sourceFile); project.resolveSourceFileDependencies(); return project; }