Skip to content

Commit

Permalink
test: add wagmi v2 test
Browse files Browse the repository at this point in the history
  • Loading branch information
q20274982 committed Jan 18, 2024
1 parent 54c65e6 commit 6afc12b
Show file tree
Hide file tree
Showing 3 changed files with 617 additions and 7 deletions.
9 changes: 6 additions & 3 deletions adapters/wagmi-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@
},
"scripts": {
"build": "tsc && vite build",
"lint": "eslint src --ext .ts"
"lint": "eslint src --ext .ts",
"test": "vitest"
},
"devDependencies": {
"@types/node": "^20.2.5",
"@wagmi/chains": "^1.8.0",
"@wagmi/core": "^2.2.0",
"typescript": "^5.1.3",
"viem": "^2.x",
"vite": "^4.3.9",
"vite-plugin-dts": "^2.3.0",
"@wagmi/core": "^2.2.0",
"viem": "^2.x"
"vitest": "^1.2.0"
},
"files": [
"/dist"
Expand Down
28 changes: 28 additions & 0 deletions adapters/wagmi-connector/src/connector.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @vitest-environment jsdom
*/

import { expect, test, describe } from 'vitest';
import { createConfig } from '@wagmi/core';
import { polygonMumbai, arbitrumGoerli } from '@wagmi/chains';
import { http } from 'viem';
import { blocto } from './index';

describe('blocto-connector', () => {
const config = createConfig({
chains: [polygonMumbai, arbitrumGoerli],
pollingInterval: 100,
storage: null,
transports: {
[polygonMumbai.id]: http(),
[arbitrumGoerli.id]: http(),
},
});

const connectorFn = blocto();
const connector = config._internal.connectors.setup(connectorFn);

test('setup', () => {
expect(connector.name).toEqual('Blocto');
});
});
Loading

0 comments on commit 6afc12b

Please sign in to comment.