Skip to content

Commit

Permalink
Add cloudflare test
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Nov 4, 2022
1 parent 7b718d2 commit 64b659b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/integrations/cloudflare/test/basics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { loadFixture, runCLI } from './test-utils.js';
import { expect } from 'chai';
import * as cheerio from 'cheerio';

describe.skip('Basic app', () => {
describe('Basic app', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;

Expand All @@ -24,6 +24,7 @@ describe.skip('Basic app', () => {
let html = await res.text();
let $ = cheerio.load(html);
expect($('h1').text()).to.equal('Testing');
expect($('#env').text()).to.equal('secret');
} finally {
stop();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';

// test env var
process.env.SECRET_STUFF = 'secret'

export default defineConfig({
adapter: cloudflare(),
output: 'server',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
</head>
<body>
<h1>Testing</h1>
<div id="env">{import.meta.env.SECRET_STUFF}</div>
</body>
</html>
4 changes: 4 additions & 0 deletions packages/integrations/cloudflare/test/wrangler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# for tests only

[vars]
SECRET_STUFF = "secret"

0 comments on commit 64b659b

Please sign in to comment.