mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-05 05:15:48 +00:00
test: remove extra polyfills only for testing (#2428)
Removes the testing polyfills by using jasmine and not jest in the browser. We were already using jasmine but where overriding those methods with jest versions which was not needed. The previous karma setup also used a single entrypoint which meant that not all integration tests were running because all files were not imported in integrations/index.ts. This also eliminates 79 dev dependencies.
This commit is contained in:
1612
package-lock.json
generated
1612
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -36,7 +36,6 @@
|
||||
"chai": "^4.3.4",
|
||||
"copyfiles": "^2.4.1",
|
||||
"crypto-browserify": "^3.12.0",
|
||||
"ejs": "^3.0.1",
|
||||
"eslint": "^8.18.0",
|
||||
"eslint-plugin-array-func": "^3.1.7",
|
||||
"eslint-plugin-consistent-default-export-name": "^0.0.15",
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// the jest.fn() API
|
||||
import * as jest from 'jest-mock'
|
||||
// The matchers API
|
||||
import expect from 'expect'
|
||||
|
||||
// Add missing Jest functions
|
||||
window.test = window.it
|
||||
window.test.each = (inputs) => (testName, test) =>
|
||||
inputs.forEach((args) => window.it(testName, () => test(...args)))
|
||||
window.test.todo = function () {
|
||||
return undefined
|
||||
}
|
||||
window.jest = jest
|
||||
window.expect = expect
|
||||
@@ -15,18 +15,13 @@ module.exports = function (config) {
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'build/xrpl-latest.js',
|
||||
'test/integration/index.ts',
|
||||
'karma-setup.js',
|
||||
],
|
||||
files: ['build/xrpl-latest.js', 'test/integration/**/*.test.ts'],
|
||||
|
||||
// preprocess matching files before serving them to the browser
|
||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
'karma-setup.js': ['webpack'],
|
||||
// Use webpack to bundle our test files
|
||||
'test/integration/index.ts': ['webpack'],
|
||||
'test/integration/**/*.test.ts': ['webpack'],
|
||||
},
|
||||
|
||||
browsers: ['ChromeHeadless'],
|
||||
|
||||
@@ -33,18 +33,13 @@
|
||||
"xrpl-secret-numbers": "^0.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@geut/browser-node-core": "^2.0.13",
|
||||
"@types/node": "^16.18.38",
|
||||
"browserify-fs": "^1.0.0",
|
||||
"constants-browserify": "^1.0.0",
|
||||
"https-browserify": "^1.0.0",
|
||||
"https-proxy-agent": "^7.0.1",
|
||||
"karma": "^6.4.1",
|
||||
"karma-chrome-launcher": "^3.1.1",
|
||||
"karma-jasmine": "^5.1.0",
|
||||
"karma-webpack": "^5.0.0",
|
||||
"lodash": "^4.17.4",
|
||||
"node-polyfill-webpack-plugin": "^2.0.1",
|
||||
"react": "^18.2.0",
|
||||
"typedoc": "0.25.0"
|
||||
},
|
||||
|
||||
@@ -1,76 +1 @@
|
||||
/* eslint-disable import/export -- Tells webpack which files exist. */
|
||||
|
||||
// These go first because they're affected by the `ledger_accept`s
|
||||
export * from './transactions/escrowFinish.test'
|
||||
export * from './transactions/escrowCancel.test'
|
||||
|
||||
// Transactions
|
||||
export * from './transactions/accountSet.test'
|
||||
export * from './transactions/ammBid.test'
|
||||
export * from './transactions/ammCreate.test'
|
||||
export * from './transactions/ammDeposit.test'
|
||||
export * from './transactions/ammVote.test'
|
||||
export * from './transactions/ammWithdraw.test'
|
||||
export * from './transactions/checkCancel.test'
|
||||
export * from './transactions/checkCash.test'
|
||||
export * from './transactions/checkCreate.test'
|
||||
export * from './transactions/depositPreauth.test'
|
||||
export * from './transactions/escrowCreate.test'
|
||||
export * from './transactions/offerCancel.test'
|
||||
export * from './transactions/offerCreate.test'
|
||||
export * from './transactions/payment.test'
|
||||
export * from './transactions/paymentChannelClaim.test'
|
||||
export * from './transactions/paymentChannelCreate.test'
|
||||
export * from './transactions/paymentChannelFund.test'
|
||||
export * from './transactions/signerListSet.test'
|
||||
export * from './transactions/trustSet.test'
|
||||
export * from './transactions/xchainAccountCreateCommit.test'
|
||||
export * from './transactions/xchainAddAccountCreateAttestation.test'
|
||||
export * from './transactions/xchainAddClaimAttestation.test'
|
||||
export * from './transactions/xchainClaim.test'
|
||||
export * from './transactions/xchainCreateBridge.test'
|
||||
export * from './transactions/xchainCreateClaimID.test'
|
||||
export * from './transactions/xchainCommit.test'
|
||||
export * from './transactions/xchainModifyBridge.test'
|
||||
|
||||
// Requests
|
||||
export * from './requests/accountChannels.test'
|
||||
export * from './requests/accountCurrencies.test'
|
||||
export * from './requests/accountInfo.test'
|
||||
export * from './requests/accountLines.test'
|
||||
export * from './requests/accountObjects.test'
|
||||
export * from './requests/accountOffers.test'
|
||||
export * from './requests/accountTx.test'
|
||||
export * from './requests/ammInfo.test'
|
||||
export * from './requests/bookOffers.test'
|
||||
export * from './requests/channelVerify.test'
|
||||
export * from './requests/depositAuthorized.test'
|
||||
export * from './requests/fee.test'
|
||||
export * from './requests/gatewayBalances.test'
|
||||
export * from './requests/ledger.test'
|
||||
export * from './requests/ledgerClosed.test'
|
||||
export * from './requests/ledgerCurrent.test'
|
||||
export * from './requests/ledgerData.test'
|
||||
export * from './requests/ledgerEntry.test'
|
||||
export * from './requests/noRippleCheck.test'
|
||||
export * from './requests/pathFind.test'
|
||||
export * from './requests/ripplePathFind.test'
|
||||
export * from './requests/serverInfo.test'
|
||||
export * from './requests/serverState.test'
|
||||
export * from './requests/submit.test'
|
||||
export * from './requests/submitMultisigned.test'
|
||||
export * from './requests/subscribe.test'
|
||||
export * from './requests/tx.test'
|
||||
export * from './requests/utility.test'
|
||||
|
||||
export * from './fundWallet.test'
|
||||
export * from './integration.test'
|
||||
export * from './onConnect.test'
|
||||
export * from './regularKey.test'
|
||||
export * from './submitAndWait.test'
|
||||
|
||||
// Because this does 256 ledger accepts, we do it last
|
||||
export * from './transactions/accountDelete.test'
|
||||
|
||||
// Ensure you export all added tests above "export * from './finalTest'", otherwise they will not be run.
|
||||
export * from './finalTest.test'
|
||||
/* eslint-disable import/unambiguous -- silence is golden */
|
||||
|
||||
@@ -99,12 +99,9 @@ function webpackForTest(testFileName) {
|
||||
extensions: ['.ts', '.js', '.json'],
|
||||
fallback: {
|
||||
module: false,
|
||||
constants: require.resolve('constants-browserify'),
|
||||
fs: require.resolve('browserify-fs'),
|
||||
buffer: require.resolve('buffer/'),
|
||||
stream: require.resolve('stream-browserify'),
|
||||
crypto: require.resolve('crypto-browserify'),
|
||||
path: require.resolve('path-browserify'),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user