Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update imports so tests can be run externally like mint #1157

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tests/functional/functional-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,22 @@ import * as url from 'node:url'
import async from 'async'
import chai from 'chai'
import _ from 'lodash'
import { AssumeRoleProvider } from 'minio/dist/main/AssumeRoleProvider.js'
import { CopyDestinationOptions, CopySourceOptions, DEFAULT_REGION } from 'minio/dist/main/helpers.js'
import * as minio from 'minio/dist/main/minio.js'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should start importing the source code minio/src/main/minio.ts instead of importing the dist output.

Should adjust mocha to able to parse typescript files too, though.

import { step } from 'mocha-steps'
import splitFile from 'split-file'
import superagent from 'superagent'
import * as uuid from 'uuid'

import { AssumeRoleProvider } from '../../src/AssumeRoleProvider.ts'
import { CopyDestinationOptions, CopySourceOptions, DEFAULT_REGION } from '../../src/helpers.ts'
import { getVersionId } from '../../src/internal/helper.ts'
import * as minio from '../../src/minio.js'

const assert = chai.assert

const isWindowsPlatform = process.platform === 'win32'

function getVersionId(headers = {}) {
return headers['x-amz-version-id'] || null
}

describe('functional tests', function () {
this.timeout(30 * 60 * 1000)
var clientConfigParams = {}
Expand Down
5 changes: 5 additions & 0 deletions tests/functional/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"moduleResolution": "classic",
"allowSyntheticDefaultImports": true,
"exclude": ["dist/**/*", "node_modules/**/*"]
}