diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2faf757c..f94f6f6b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/src/coinbase/tests/e2e.ts b/src/coinbase/tests/e2e.ts index 950529ab..3d1b2924 100644 --- a/src/coinbase/tests/e2e.ts +++ b/src/coinbase/tests/e2e.ts @@ -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();