Skip to content

Commit

Permalink
esbuild test project fixes (#2045)
Browse files Browse the repository at this point in the history
  • Loading branch information
anniel-stripe authored Mar 21, 2024
1 parent e84d7c9 commit 7293b69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion testProjects/esbuild/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Stripe} from 'stripe';
import assert from 'assert';

// API key is null to trigger an authentication error
const stripe = new Stripe(null, {
const stripe = new Stripe("i'm not a real key", {
host: process.env.STRIPE_MOCK_HOST || 'localhost',
port: process.env.STRIPE_MOCK_PORT || 12111,
protocol: 'http',
Expand All @@ -21,6 +21,7 @@ try {
async function exampleFunction(args) {
try {
await stripe.paymentIntents.create(args);
throw new Error('Expected an error');
} catch (e) {
assert (e instanceof stripe.errors.StripeAuthenticationError);
assert (e.type === 'StripeAuthenticationError');
Expand Down

0 comments on commit 7293b69

Please sign in to comment.