Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Nov 23, 2024
1 parent 27085ef commit 52f81e1
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
1 change: 1 addition & 0 deletions example/functions/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ScanCommand,
UpdateCommand,
} from "@aws-sdk/lib-dynamodb";

import type { Todo } from "./react/TodoList";

const uid = () =>
Expand Down
4 changes: 2 additions & 2 deletions example/functions/src/ssr.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fs from "fs/promises";
import React from "react";
import ReactDOMServer from "react-dom/server";
import App from "./react/App";

import React from "react";
import API from "./api";
import App from "./react/App";

type Method = "GET" | "POST" | "PUT" | "DELETE";

Expand Down
10 changes: 5 additions & 5 deletions example/infrastructure/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { execSync } from "child_process";
import * as fs from "fs/promises";
import os from "os";
import path from "path";
import {
App,
CfnOutput,
Duration,
Fn,
Stack,
aws_apigatewayv2,
aws_apigatewayv2_integrations,
aws_cloudfront,
Expand All @@ -17,8 +14,11 @@ import {
aws_lambda_nodejs,
aws_logs,
aws_s3,
CfnOutput,
Duration,
Fn,
Stack,
} from "aws-cdk-lib";
import * as fs from "fs/promises";

const main = async () => {
execSync("node build.mjs", {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { equals, isA, pluralize } from "./jest-utils";
import { stringify } from "./stringify";

/*
MIT License
Expand Down Expand Up @@ -27,9 +30,6 @@ SOFTWARE.

import ChaiPlugin = Chai.ChaiPlugin;

import { equals, isA, pluralize } from "./jest-utils";
import { stringify } from "./stringify";

export interface AsymmetricMatcherInterface {
asymmetricMatch: (other: unknown) => boolean;
toString: () => string;
Expand Down
5 changes: 2 additions & 3 deletions llrt_core/src/modules/js/@llrt/expect/jest-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SOFTWARE.

// Extracted and modified from Vitest: https://github.com/vitest-dev/vitest/blob/a199ac2dd1322d7839d4d1350c983070da546805/packages/expect/src/jest-expect.ts

import type { AsymmetricMatcher } from "./jest-asymmetric-matchers";
import {
arrayBufferEquality,
generateToBeMessage,
Expand All @@ -34,9 +35,9 @@ import {
subsetEquality,
typeEquality,
} from "./jest-utils";

import ChaiPlugin = Chai.ChaiPlugin;
import Assertion = Chai.Assertion;
import type { AsymmetricMatcher } from "./jest-asymmetric-matchers";

// Jest Expect Compact
export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
Expand All @@ -61,7 +62,6 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
};

if (Array.isArray(name)) name.forEach((n) => addMethod(n));

else addMethod(name);
}

Expand Down Expand Up @@ -211,7 +211,6 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
});
def("toMatch", function (expected: string | RegExp) {
if (typeof expected === "string") return this.include(expected);

else return this.match(expected);
});
def("toContain", function (item) {
Expand Down
1 change: 0 additions & 1 deletion llrt_core/src/modules/js/@llrt/expect/jest-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ function eq(
// circular references at same depth are equal
// circular reference is not equal to non-circular one
if (aStack[length] === a) return bStack[length] === b;

else if (bStack[length] === b) return false;
}
// Add the first object to the stack of traversed objects.
Expand Down
2 changes: 1 addition & 1 deletion llrt_core/src/modules/js/@llrt/expect/stringify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ SOFTWARE.

// Extracted and modified from Vitest: https://github.com/vitest-dev/vitest/blob/0f86ff98975a80191d6215b0d30ff6cd9f8388d3/packages/utils/src/stringify.ts

import type { PrettyFormatOptions } from "pretty-format";
import {
format as prettyFormat,
plugins as prettyFormatPlugins,
type PrettyFormatOptions,
} from "pretty-format";

const {
Expand Down
1 change: 1 addition & 0 deletions llrt_core/src/modules/js/@llrt/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import * as chai from "chai";

import { JestAsymmetricMatchers } from "./expect/jest-asymmetric-matchers";
import { JestChaiExpect } from "./expect/jest-expect";

Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/dynamodb.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

import {
BillingMode,
DynamoDB,
waitUntilTableExists,
type CreateTableCommandOutput,
type DeleteItemCommandOutput,
type DescribeTableCommandOutput,
DynamoDB,
type GetItemCommandOutput,
waitUntilTableExists,
} from "@aws-sdk/client-dynamodb";
import {
DynamoDBDocument,
NumberValue,
type BatchExecuteStatementCommandOutput,
type BatchGetCommandOutput,
type BatchWriteCommandOutput,
DynamoDBDocument,
type ExecuteStatementCommandOutput,
type ExecuteTransactionCommandOutput,
type GetCommandOutput,
NumberValue,
type PutCommandOutput,
type QueryCommandOutput,
type ScanCommandOutput,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/compile.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { spawn } from "child_process";
import { tmpdir } from "os";
import fs from "fs/promises";
import { tmpdir } from "os";

const spawnCapture = async (cmd: string, args: string[]) => {
const child = spawn(cmd, args);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/fs.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import defaultFsImport from "fs";
import * as namedFsImport from "fs";
import fs from "fs/promises";
import os from "os";
import path from "path";
import fs from "fs/promises";

describe("readdir", () => {
it("should read a directory", async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/xml.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { XMLParser, XmlNode, XmlText } from "llrt:xml";
import { XmlNode, XMLParser, XmlText } from "llrt:xml";

describe("XMLParser options and handling", () => {
it("should parse xml", () => {
Expand Down

0 comments on commit 52f81e1

Please sign in to comment.