mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
d9b941c302
* Revert "chore: added clarifying docs for the type change (#10804)" This reverts commit25387ae1ce. * Revert "fix: transformRequest input typing (#10745)" This reverts commit694f1eca8c.
29 lines
956 B
JavaScript
29 lines
956 B
JavaScript
const path = require('path');
|
|
const { describe, it } = require('mocha');
|
|
const { createTempFixture, cleanupTempFixture } = require('./helpers/fixture.cjs');
|
|
const { runCommand } = require('./helpers/run-command.cjs');
|
|
|
|
const suiteRoot = path.resolve(__dirname, '..');
|
|
const repoRoot = path.resolve(suiteRoot, '../../..');
|
|
const tscBin = path.join(suiteRoot, 'node_modules', 'typescript', 'bin', 'tsc');
|
|
|
|
const tsconfig = {
|
|
compilerOptions: {
|
|
checkJs: true,
|
|
module: 'node16',
|
|
},
|
|
};
|
|
|
|
describe('module cjs typings compatibility', () => {
|
|
it('type-checks commonjs axios typings', () => {
|
|
const sourcePath = path.join(repoRoot, 'tests/module/cjs/tests/helpers/cjs-typing.ts');
|
|
const fixturePath = createTempFixture(suiteRoot, 'typings-cjs', sourcePath, tsconfig);
|
|
|
|
try {
|
|
runCommand('node', [tscBin, '--noEmit', '-p', 'tsconfig.json'], { cwd: fixturePath });
|
|
} finally {
|
|
cleanupTempFixture(fixturePath);
|
|
}
|
|
});
|
|
});
|