0.4.22 • Published 3 days ago

@autometa/runner v0.4.22

Weekly downloads
-
License
MIT
Repository
-
Last release
3 days ago

Autometa

Full Docs

NOTICE

Autometa is under construction. It is currently unstable, poorly documented and not production ready for most cases.

Check back soon.

The following libraries may be considered relatively stable, but may contain bugs or unclear errors

  • Overloaded - Function and method overloads that are as pleasant to make as they are to use
  • Bind Decorator - Binds the this keyword on a class method. Respectfully a fork of bind-decorator
  • Status Codes - Object containing HTTP status codes and status messages, visible in the editor via as const

Autometa

Autometa is an early-development automation framework toolkit, which provides libraries to help automate the automation process on node with libraries to help bootstrap your node automation framework, for API or E2E testing.

Full Docs

Cucumber Runner

The Cucumber Runner lets you build and execute Cucumber style tests with alternative test runners. Currently supported are jest and vitest. Mocha likely works but has not been tested.

Initially inspired by jest-cucumber provides a customizable hybrid approach between cucumbers flat global steps and jest-cucumbers nested spec-like tests.

Dependency injection is supported to make initializing client classes needed to interface with your service or website simple and logic-free, with unique copies provided to each executing tests.

import { Feature, Given, When, Then, Before } from "@autometa/cucumber-runner";
import { App } from "./my-app";
import * as seedData from "./seed-data";

Before("Seed the database", async ({ dbClient }: App) => {
  await dbClient.seed(seedData);
});
Given("a user who wants to log in", () => {});
When("a user submits their credentials", () => {});
Then("a user sees their", () => {});

// tests assembled automatically
Feature("./my-feature.feature");

Steps can also be nested or groups to override higher level steps.

import {
  Feature,
  Given,
  When,
  Then,
  Before,
  ScenarioOutline,
  Scenario,
  Rule,
} from "@autometa/cucumber-runner";
import { App } from "./my-app";
import * as seedData from "./seed-data";

Before("Seed the database", async ({ dbClient }: App) => {
  await dbClient.seed(seedData);
});
Given("a user who wants to log in", () => {});
When("a user submits their credentials", () => {});

Feature(() => {
  Scenario("a user logs in successfully", () => {
    Then("a user sees their profile", () => {});
  });

  Scenario("a user cannot log in without a password", () => {
    Then(
      "a user is informed they cannot log in",
      (expectedError: string) => {}
    );
  });
  Rule("a rule", () => {
    ScenarioOutline("some outline", () => {
      // define steps unique to `some outline`
    });
  });
}, "./my-feature.feature");

Dto Builder

Implementation of the Builder pattern that allows automatically generating builder classes from a DTO class prototype, with type-safe builder methods in place of DTO properties.

import { dto, Builder } from '@autometa/dto-builder'
export class UserDto {
    id: number
    username: string,
    // default values, factories, dtos
    @DTO.dto(AddressDto)
    address: AddressDto
    @DTO.date()
    createdAt: Date
}
// or
// avoid duplicating interface properties
export class UserDto extends DTO<IUser> {}

const UserDtoBuilder = Builder(UserDto);

const user = new UserDtoBuilder().id(1).name('bob').build()

// compilation error, 'first argument of "id" must be a number"
 new UserDtoBuilder().id('1').name('bob').build()
 // force it to pass a string
 new UserDtoBuilder().id('1' as unknown as number).name('bob').build()
0.4.22

3 days ago

0.4.20

10 days ago

0.4.21

10 days ago

0.4.19

24 days ago

0.4.18

1 month ago

0.4.17

1 month ago

0.4.16

3 months ago

0.4.15

3 months ago

0.4.13

4 months ago

0.4.11

4 months ago

0.4.12

4 months ago

0.4.10

4 months ago

0.4.9

4 months ago

0.4.8

4 months ago

0.3.3

4 months ago

0.4.5

4 months ago

0.4.4

4 months ago

0.4.7

4 months ago

0.4.6

4 months ago

0.4.1

4 months ago

0.4.0

4 months ago

0.4.3

4 months ago

0.4.2

4 months ago

0.3.2

4 months ago

0.3.1

4 months ago

0.3.0

5 months ago

0.2.59

5 months ago

0.2.58

5 months ago

0.2.57

5 months ago

0.2.56

5 months ago

0.2.55

5 months ago

0.2.52

6 months ago

0.2.51

6 months ago

0.2.54

6 months ago

0.2.53

6 months ago

0.2.50

6 months ago

0.2.49

6 months ago

0.2.48

6 months ago

0.2.47

6 months ago

0.2.46

6 months ago

0.2.45

6 months ago

0.2.44

6 months ago

0.2.43

7 months ago

0.2.42

7 months ago

0.2.41

7 months ago

0.2.40

7 months ago

0.2.39

7 months ago

0.2.38

7 months ago

0.2.37

7 months ago

0.2.36

7 months ago

0.2.35

7 months ago

0.2.34

7 months ago

0.2.33

7 months ago

0.2.32

7 months ago

0.2.31

7 months ago

0.2.30

7 months ago

0.2.29

7 months ago

0.2.28

7 months ago

0.2.27

7 months ago

0.2.26

7 months ago

0.2.25

7 months ago

0.2.24

7 months ago

0.2.23

7 months ago

0.2.22

7 months ago

0.2.21

7 months ago

0.2.20

7 months ago

0.2.19

7 months ago

0.2.18

7 months ago

0.2.17

7 months ago

0.2.16

7 months ago

0.2.15

7 months ago

0.2.14

7 months ago

0.2.13

7 months ago

0.2.12

7 months ago

0.2.11

7 months ago

0.2.10

7 months ago

0.2.9

7 months ago

0.2.8

7 months ago

0.2.7

7 months ago

0.2.6

7 months ago

0.2.5

7 months ago

0.2.4

8 months ago

0.2.3

8 months ago

0.2.2

8 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago