aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/process-nexttick.test.js
blob: ac53399c00b27301ba6ddd268e8481ccf5d68d3f (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { it } from "bun:test";

it("process.nextTick", async () => {
  // You can verify this test is correct by copy pasting this into a browser's console and checking it doesn't throw an error.
  var run = 0;
  var queueMicrotask = process.nextTick;

  await new Promise((resolve, reject) => {
    queueMicrotask(() => {
      if (run++ != 0) {
        reject(new Error("Microtask execution order is wrong: " + run));
      }
      queueMicrotask(() => {
        if (run++ != 3) {
          reject(new Error("Microtask execution order is wrong: " + run));
        }
      });
    });
    queueMicrotask(() => {
      if (run++ != 1) {
        reject(new Error("Microtask execution order is wrong: " + run));
      }
      queueMicrotask(() => {
        if (run++ != 4) {
          reject(new Error("Microtask execution order is wrong: " + run));
        }

        queueMicrotask(() => {
          if (run++ != 6) {
            reject(new Error("Microtask execution order is wrong: " + run));
          }
        });
      });
    });
    queueMicrotask(() => {
      if (run++ != 2) {
        reject(new Error("Microtask execution order is wrong: " + run));
      }
      queueMicrotask(() => {
        if (run++ != 5) {
          reject(new Error("Microtask execution order is wrong: " + run));
        }

        queueMicrotask(() => {
          if (run++ != 7) {
            reject(new Error("Microtask execution order is wrong: " + run));
          }
          resolve(true);
        });
      });
    });
  });

  {
    var passed = false;
    try {
      queueMicrotask(1234);
    } catch (exception) {
      passed = exception instanceof TypeError;
    }

    if (!passed)
      throw new Error(
        "queueMicrotask should throw a TypeError if the argument is not a function"
      );
  }

  {
    var passed = false;
    try {
      queueMicrotask();
    } catch (exception) {
      passed = exception instanceof TypeError;
    }

    if (!passed)
      throw new Error(
        "queueMicrotask should throw a TypeError if the argument is empty"
      );
  }

  await new Promise((resolve, reject) => {
    process.nextTick(
      (first, second) => {
        if (first !== 12345 || second !== "hello")
          reject(new Error("process.nextTick called with wrong arguments"));
        resolve(true);
      },
      12345,
      "hello"
    );
  });
});
/renderer-svelte@0.2.2&id=2a2eaadc2f5ca0ac88eb3fd987881a47b41e9bdd&follow=1'>Invalidate based on modulePath (#2086)Gravatar Matthew Phillips 2-7/+9 * Invalidate based on modulePath * Adds a changeset 2021-12-01Update ci.yml (#2077)Gravatar Fred K. Schott 1-2/+7 2021-12-01[ci] yarn formatGravatar natemoo-re 2-4/+4 2021-12-01Improving error messages for invalid client hydration directives (#2076)Gravatar Tony Sullivan 6-0/+64 * Adding check to make sure the hydration directive is valid * remove temp debug logging * Adding a check for media query with client:media + small refactor * adding changeset Co-authored-by: Tony Sullivan <tony.sullivan@hyperlab.se> 2021-12-01Upgrade compiler to 0.5.4 (#2057)Gravatar Matthew Phillips 3-6/+6 * Upgrade compiler to 0.4.0 * chore: update compiler to v0.5.1 * chore: update compiler to v0.5.3 * chore: upgrade @astrojs/compiler * test: skip flaky test Co-authored-by: Nate Moore <nate@skypack.dev> 2021-12-01Render void elements as self-closing tags (#2064)Gravatar Jonathan Neal 5-1/+64 * Render void elements as self-closing tags * changeset * nit: only check void element names if there is no child content * nit: only check void element names if there is no child content * add tests 2021-12-01Allow importing of rehype plugins (#2075)Gravatar Drew Powers 3-1/+11 Fixes #2061 2021-12-01fix: release notes (#2074)Gravatar Nate Moore 1-1/+3 2021-12-01[ci] yarn formatGravatar natemoo-re 1-2/+2 2021-12-01Prevent unknown keys in markdownOptions (#2073)Gravatar Ian VanSchooten 2-0/+7 2021-12-01Add migration guide for markdownOptions (#2070)Gravatar Ian VanSchooten 1-0/+23 2021-12-01German translation - docs (#1830)Gravatar borisv 15-109/+1537 * New translation of getting-started.md Rework of the basic translation, resolving a bunch of issues and correcting misconceptions in terminologies. * Spelling correction * Omitting redundant paragraph. Minor corrections. * New translation Fixing errors and grammatical misconceptions. Rectifying terminology. * Minor corrections in quick-start.md * Update quick-start.md Minor corrections * Update quick-start.md Small fix * Update quick-start.md * Update getting-started.md * Update quick-start.md * Update quick-start.md * Update quick-start.md * New translation installation.md New translation leveraging a consistent nomenklatura, fixing spelling errors * Update installation.md * Update installation.md * Update installation.md * Update docs/src/pages/de/getting-started.md Co-authored-by: Kim Schneider <web@schneider.kim> * Update docs/src/pages/de/getting-started.md Co-authored-by: Kim Schneider <web@schneider.kim> * Update docs/src/pages/de/getting-started.md Co-authored-by: Kim Schneider <web@schneider.kim> * Update docs/src/pages/de/installation.md Co-authored-by: Kim Schneider <web@schneider.kim> * Update docs/src/pages/de/quick-start.md Co-authored-by: Kim Schneider <web@schneider.kim> * Update docs/src/pages/de/quick-start.md Co-authored-by: Kim Schneider <web@schneider.kim> * Update docs/src/pages/de/quick-start.md Co-authored-by: Kim Schneider <web@schneider.kim> * Update docs/src/pages/de/installation.md Co-authored-by: Kim Schneider <web@schneider.kim> * Update docs/src/pages/de/getting-started.md Co-authored-by: Kim Schneider <web@schneider.kim> * [ci] yarn format * Create 0.21.0.md First translation * [ci] yarn format * Create themes.astro First translation * Create 404.astro First translation * Update 0.21.0.md Small changes according to the reviews. Additionally changing 'Hydratation' to 'Anreicherung' in the code example (76), which is far more closer to the fact. * [ci] yarn format * Update themes.astro Changed 'Motive' to 'Vorlagen' throughout this document * Create comparing-astro-vs-other-tools.md First translation. Last missing page from the first documentation section 'SETUP' * [ci] yarn format * Create astro-components.md First translation * [ci] yarn format * Update comparing-astro-vs-other-tools.md Corrected reference to Vue in Nuxt section * Update comparing-astro-vs-other-tools.md Replaced 'Vorlagen' with the english term 'Templates' for consistency inside nomenclature across all document pages. * Create astro-pages.md First translation * [ci] yarn format * Create project-structure.md First translation * Create component-hydration.md New translation * [ci] yarn format * Create layouts.md First translation * Create routing.md First translation * [ci] yarn format * Update quick-start.md Changed expression to 'Entwickeln' * Update installation.md Changed expression to 'Entwickeln' * Update comparing-astro-vs-other-tools.md Changed all occurences of 'partielle Anreicherung' to 'Partial Hydration' * Update comparing-astro-vs-other-tools.md Minor punctuation fix * Update astro-components.md Bunch of suggestions worked in * [ci] yarn format * Update astro-pages.md Added suggestions * Update component-hydration.md Added suggestions * Update layouts.md Added suggestions * [ci] yarn format * Update project-structure.md Added suggestions * Update routing.md Added suggestions * Update installation.md Added suggestions * Update 0.21.0.md Added suggestions * Update quick-start.md added suggestions * Update themes.astro Added suggestions * Update 0.21.0.md Added suggestion * Update astro-components.md Minor punctuation fix * [ci] yarn format * Update astro-components.md Replaced last of 'Anreicherung' * Update astro-components.md Punctuation fix, again((( * [ci] yarn format * Update docs/src/pages/de/core-concepts/astro-components.md Minor punctioation fix Co-authored-by: Kim Schneider <web@schneider.kim> * [ci] yarn format * Update astro-components.md Added code example, since github hickubs when only removing ';' * Added sidebar links (de) config.ts Added links to the first two sections of the German translation * Update config.ts Replaced Getting Started with 'Erste Schritte' * Update config.ts Replaced Themes with 'Vorlagen' * Update config.ts Changed Migration to 'Umstellung' * Fixing routing error((( * Fixing routing errors(( * reverse and fix routing errors((( Co-authored-by: Kim Schneider <web@schneider.kim> Co-authored-by: borisv <borisv@users.noreply.github.com> Co-authored-by: smplrtrn <smplrtrn@gmail.com> 2021-12-01Enforce consistent import order of CSS (#2065)Gravatar Drew Powers 11-11/+134 Partially fixes #2060 2021-11-30[ci] release (#2059)astro@0.21.6Gravatar github-actions[bot] 26-37/+32 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> 2021-11-30Modify changeset for #2052 (#2067)Gravatar Drew Powers 1-1/+1