Skip to content

Commit

Permalink
Adding dry-run check
Browse files Browse the repository at this point in the history
  • Loading branch information
erdimaden committed Jun 3, 2024
1 parent ceeea0d commit 638faf4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ jobs:
NAME: ${{ secrets.NAME }}
PRIVATEKEY: ${{ secrets.PRIVATEKEY }}
SEED: ${{ secrets.SEED }}
run: npm run test:e2e
- run: npm install
- run: npm ci
- run: npm publish --dry-run
- run: npm run test:e2e

10 changes: 10 additions & 0 deletions src/coinbase/tests/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,26 @@ describe("Coinbase SDK E2E Test", () => {
beforeAll(() => {
dotenv.config();
});

beforeEach(() => {
coinbase = new Coinbase({
apiKeyName: process.env.NAME,
privateKey: process.env.PRIVATEKEY,
});
});

it("should be able to access environment variables", () => {
expect(process.env.NAME).toBeDefined();
expect(process.env.PRIVATEKEY).toBeDefined();
});

it("should have created a dist folder for NPM", () => {
expect(fs.existsSync("./dist")).toBe(true);
expect(fs.existsSync("./dist/index.js")).toBe(true);
expect(fs.existsSync("./dist/client/index.js")).toBe(true);
expect(fs.existsSync("./dist/coinbase/coinbase.js")).toBe(true);
});

it("should be able to interact with the Coinbase SDK", async () => {
console.log("Fetching default user...");
const user = await coinbase.getDefaultUser();
Expand Down

0 comments on commit 638faf4

Please sign in to comment.