summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/mdx-page.test.js
blob: 726f091c90232a061a8aa5c7fa436ce07b9ae31c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import mdx from '@astrojs/mdx';

import { expect } from 'chai';
import { parseHTML } from 'linkedom';
import { loadFixture } from '../../../astro/test/test-utils.js';

describe('MDX Page', () => {
	let fixture;

	before(async () => {
		fixture = await loadFixture({
			root: new URL('./fixtures/mdx-page/', import.meta.url),
		});
	});

	describe('build', () => {
		before(async () => {
			await fixture.build();
		});

		it('works', async () => {
			const html = await fixture.readFile('/index.html');
			const { document } = parseHTML(html);

			const h1 = document.querySelector('h1');

			expect(h1.textContent).to.equal('Hello page!');
		});

		it('injects style imports when layout is not applied', async () => {
			const html = await fixture.readFile('/index.html');
			const { document } = parseHTML(html);

			const stylesheet = document.querySelector('link[rel="stylesheet"]');

			expect(stylesheet).to.not.be.null;
		});
	});

	describe('dev', () => {
		let devServer;

		before(async () => {
			devServer = await fixture.startDevServer();
		});

		after(async () => {
			await devServer.stop();
		});

		it('works', async () => {
			const res = await fixture.fetch('/');

			expect(res.status).to.equal(200);

			const html = await res.text();
			const { document } = parseHTML(html);

			const h1 = document.querySelector('h1');

			expect(h1.textContent).to.equal('Hello page!');
		});
	});
});
now * Update tsconfig.base.json * Fix ThisOutsideFunctionNotRenamed * woopsie * moar cpu * clamp it * fixup * Add a bunch of assertions * Bun uses automatic runtime by default * Parse Import Attributes * Add a note about Valgrind * Update developing.md * Fix up code splitting for React Server Components * Implement client component manifest * Fix crash with --react-server-components and no client components * Backport https://github.com/ziglang/zig/commit/4d31e3c917a05541394c544708f0047cfb53331a * Update launch.json * Fix for latest zig * Workaround bug with ?[]const string Occasionally saw alignment errors in this code Workaround https://github.com/ziglang/zig/issues/15085 related: https://github.com/ziglang/zig/pull/15089 * switch to regular slice * Avoid initializing named_imports and named_exports as undefined * Reduce usages of `undefined` * Add more assertions * --watch wip * Update javascript.zig * Possibly fix the race condition * Faster `do` * bump allocator * Reduce the size of `Symbol` slightly * Alphabetically sort runtime import symbols, for determinism * Prepare for code splitting * handle overlapping stdout * pure * clean up some things * Fix bug with `$$typeof` * Address CommonJS -> ESM hoisting bug * Support `"use server"` in manifest * Implement `"use server"` * Fix importing bun builtins when bundling * Make `commonjs_to_esm` a feature flag, fix some splitting bugs * :scissors: * fixme remove this * Fix crash in longestCommonPath * Chunking! Just need to do import paths now. * Import paths work...now trying to figure out how to make runtime symbols work * add workaround * Replace `bun bun` with `bun build` * Fix crash with dual package hazard * Fix many CommonJS <> ESM interop bugs * Support package.json `"sideEffects"` also skip loading unnecessary package.json data in `bun run` * add a not good --watch implementation * bundler test refining, 140/831 * remove accidentally committed file * do not return status code 1 on successful bundles * bundler test refining, 159/830 * pass exit code to exitOrWatch * clean up help menu -remove two spaces to line up bun build -moved all <r> tags to the end of the text they are colorizing -moved other colors to the start of the text they colorize -removed unneeded <r> tags, keeping only one at the start of the block * importstar is fully ported * wip * you can run code in this branch now * Disable this transform * organize and document bundler tests * Fix double import * Fix sloppy mode function declarations * Disable our CommonJS transform for now * add `assertNotPresent` to make splitting cases easier * Bump! * Update bun.d.ts * use import.meta.require in runtime code * Disable this again * Fix dirname * Fix ESM -> CJS wrapper * :nail_care: --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Alex Lam S.L <alexlamsl@gmail.com> Co-authored-by: Derrick Farris <mr.dcfarris@gmail.com> Co-authored-by: Ashcon Partovi <ashcon@partovi.net> Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com> Co-authored-by: pfg <pfg@pfg.pw> Co-authored-by: Colin McDonnell <colinmcd94@gmail.com> Co-authored-by: dave caruso <me@paperdave.net> Co-authored-by: zhiyuan <32867472+zhiyuang@users.noreply.github.com> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com> Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com> 2023-04-07Fix trailing slash bug in upload scriptGravatar Ashcon Partovi 1-1/+1 2023-04-07Fix environment variables in workflowGravatar Ashcon Partovi 2-4/+4 2023-04-07Upload releases to S3Gravatar Ashcon Partovi 5-1/+171 2023-04-07Add TSConfig object type to TranspilerOptions interface (#2545)Gravatar Jake Boone 1-1/+21 2023-04-07chore: simplify prettier command and cache (#2589)Gravatar hiroki osame 1-1/+1 2023-04-07`FileBlob` -> `BunFile`, add `BunFile.lastModified` (#2581)Gravatar Colin McDonnell 4-77/+119 * Improve BunPlugin types * FileBlob -> BunFile * Update Bun.env types. Fixes #2481 * Add lastModified to BunFile 2023-04-07feat(tls.Server) basic support (cert, key, rejectUnauthorized, requestCert, ↵Gravatar Ciro Spaciari 23-10346/+13923 ca) #2412 (#2552) * cherry picked * add StringOrBuffer parameter * Format and adds types * update uws * fix tests * more types * fix typing * add timeouts, clean some stuff * move tests to describe * fixes SSL hostname when Host is provided * cleanup on tests * change 127.0.0.1 to 0.0.0.0 * try another listening parameter * test timings and update uws * remove unnecessary comment * move listening event around * always await Bun.connect * do not fail if the tests already passed when using Bun.connect * regenerate classes * undo generated classes * generate classes * fix merge --------- Co-authored-by: cirospaciari <cirospaciari@MiWiFi-RA82-srv.cirospaciari> 2023-04-06Proactively add these to the listGravatar Jarred Sumner 1-0/+2 2023-04-06BumpGravatar Jarred Sumner 1-1/+1 2023-04-06fix: export `constants` from `fs/promises` (#2567)Gravatar dave caruso 6-6/+14 * fix: export `constants` from `fs/promises` * fix type tests * third time's the charm fixing the typedef * run fmt * remove injected constant from fs, re-exporting from fs/promises 2023-04-06docs: add a section on uninstalling bun (#2560)Gravatar dave caruso 1-0/+8 2023-04-06docs(cli/bunx): add notice (#2574)Gravatar Jozef Steinhübl 1-0/+4 * docs(cli/bunx): add notice bunx alias bun x * docs: grammar 2023-04-06Fix `toEqual` when the second array has extra array holes (#2580)Gravatar Dylan Conway 3-18/+76 * iterate through remaining indexes, keep prop identifier * tests * format 2023-04-06Add last modify field "mtime" for FileBlob (#1431) (#2491)Gravatar Zhongwei Yao 6-33/+128 * Add lastModified field for FileBlob (#1431) lastModified value is epoch timestamp in millisecond unit. * update according to review comment. 2023-04-06bun-types: infer strict `Subprocess` from `Bun.spawn()` options, part 2 (#2573)Gravatar dave caruso 9-67/+165 2023-04-06cache needs to update, move to another process (#2578)Gravatar Dylan Conway 2-156/+171 2023-04-06fix(ws): export Server (#2575)Gravatar hiroki osame 1-13/+30 2023-04-06docs(CONTRIBUTING): referece development guide (#2576)Gravatar hiroki osame 1-1/+5 2023-04-05rebase (#1501)Gravatar dave caruso 2-144/+305 2023-04-05Update `typecheck` (#2572)Gravatar Colin McDonnell 3-4/+8 * Update typecheck * Test ci * Test ci * Prettify files 2023-04-05prependGravatar Jarred Sumner 1-7/+3 2023-04-05Add tests for `bun test` with preload scripts (#2566)Gravatar Jake Boone 2-1/+107 * Use zsh-compatible syntax in cowsay example zsh interprets the string !" differently than bash or sh, but we can use single quotes in all of them. See https://unix.stackexchange.com/a/497335/548905. * Add tests for bun:test with preload scripts * Look at `stderr` in `bun test --preload` tests 2023-04-05Disable buffering when we clear terminalGravatar Jarred Sumner 1-0/+2 hopefully fixes an issue reported in Discord 2023-04-05PrettierGravatar Jarred Sumner 3-4/+4 2023-04-05fix(fetch.proxy) fix proxy authentication (#2554)Gravatar Ciro Spaciari 3-31/+186 * fix proxy authentication * add auth tests * remove unused 2023-04-05fix: build warnings (#2562)Gravatar hiroki osame 4-4/+1 2023-04-05In Documentation, move --watch before the script name (#2569)Gravatar Lawlzer 1-4/+5 Related message by Jarred: https://discord.com/channels/876711213126520882/876711213126520885/1093286199369682944 If you put `--watch` after the script name, it will not work. 2023-04-05fix `deepEquals` with array holes and accessors (#2557)Gravatar Dylan Conway 2-10/+249 * `deepEqual` handles slow array indexes * another test * oops * remove bad test * compare indexes in non-strict mode * more tests 2023-04-05fix: modules to have null prototype (#2561)Gravatar hiroki osame 2-2/+9 2023-04-04:clock1: :clock2: :clock3:Gravatar Jarred Sumner 1-1/+1 2023-04-04Implement `import.meta.main` (#2556)Gravatar Jarred Sumner 10-8/+89 * Implement `import.meta.main` * Update main-test-1.js * Update fs.test.ts --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-04-04Dylan/fix some failing tests (#2544)Gravatar Jarred Sumner 10-29/+72 * handle `umask()` invalid arguments * move `bktree-fast` to test root, fix postinstall * fix fs test * could be baseline * handle different timezones * accidentally deleted tests * fix hang in `AbortSignal.timeout` * bring abort tests back * Revert "bring abort tests back" This reverts commit 0ff2ad5bf408694ac719b8ba0a38b16070e10201. * bunx node-gyp * bun x * fix typecheck * test * Update inspect.test.js --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com> 2023-04-04Add npm benchmark (#2555)Gravatar Colin McDonnell 13-1/+271 * Add install bench * Update scripts and readme * remove lockfiles * Format bench * Add dev instructions 2023-04-03Use absolute paths morebun-v0.5.9Gravatar Jarred Sumner 2-6/+11 2023-04-03Fix test failureGravatar Jarred Sumner 1-15/+18