Skip to content

Commit

Permalink
fix: run tests only with environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickHeneise committed Apr 11, 2022
1 parent 921408b commit 88253bd
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/cloudflare.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ import t from 'tap'
import fn from '../cloudflare.js'

const test = t.test

test('put', async (t) => {
const skip = process.env.CI

test(
'skip tests on ci as env variables are require',
{ skip: !skip },
async (t) => {
t.ok(true)
return
}
)

test('put', { skip: skip }, async (t) => {
const testObj = { hello: 'world' }

const accountId = process.env.CLOUDFLARE_ACCOUNT_ID
Expand All @@ -31,7 +41,7 @@ test('put', async (t) => {
t.same(actual, null)
})

test('get', async (t) => {
test('get', { skip: skip }, async (t) => {
const accountId = process.env.CLOUDFLARE_ACCOUNT_ID
const apiKey = process.env.CLOUDFLARE_API_KEY
const accountEmail = process.env.CLOUDFLARE_ACCOUNT_EMAIL
Expand Down

0 comments on commit 88253bd

Please sign in to comment.