open-index/open-npm huggingface dataset:
npm package: @gxxc/appsync-template-tester
Description: Unit test AppSync VTL resolvers, with popular frameworks such as Jest
Latest version: 1.1.17

# Appsync VTL Tester

[![Built with
typescript](https://badgen.net/badge/icon/typescript?icon=typescript&label)](https://www.typescriptlang.org/)
[![version](https://badgen.net/npm/v/appsync-template-tester)](https://www.npmjs.com/package/appsync-template-tester)
[![downloads](https://badgen.net/npm/dt/appsync-template-tester)](https://www.npmjs.com/package/appsync-template-tester)

Write unit tests for AWS AppSync VTL resolvers, with popular frameworks such as Jest.

## Use

### Example

```shell
yarn add appsync-template-tester --dev
```

```typescript
import Parser from 'appsync-template-tester';
import { readFileSync } from 'fs';
import { join } from 'path';

// Load from a file (if not in a string already)
const templateFilePath = join(__dirname, './pathToFile.vtl');
const template = readFileSync(templateFilePath, {
  encoding: 'utf8',
});

// Create the resolver
const parser = new Parser(template);

test('Test the resolver', () => {
  // The Appsync Context (ctx) object
  const context = {
    // For example with a dynamoDB response resolver:
    result: {
      id: 'testId',
      // ...
    },
  };

  // parser.resolve() automatically typecasts
  const response = parser.resolve(context);

  // For convenience, the response is returned as a JS object rather than JSON
  expect(response.id).toBe('testId');
});
```

### Util helpers supported

This module supports all the provided core, map & time \$util methods, and most of the dynamodb methods. The underlying methods can be seen in the [Resolver Mapping Template Utility Reference
docs](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-util-reference.html).

Note: The errors list is also not returned (but \$util.error will throw an error).
npm package: @gxxc/nx-anchor
Description: An NX plugin for running Anchor commands
Author: gxxcastillo
Latest version: 0.0.10

# @gxxc/nx-anchor

An NX plugin for running Anchor commands

## Build Executor

Runs the Anchor "build" command

```json filename="project.json"
{
  ...
  "targets": {
    "build": {
      "executor": "@gxxc/nx-anchor:build"
    }
  }
}
```

Then, from the root of your nx project:
```
> nx build <project-name>
```

## Test Executor

Runs the Anchor "test" command

```json filename="project.json"
{
  ...
  "targets": {
    "test": {
      "executor": "@gxxc/nx-anchor:test"
    }
  }
}
```

Then, from the root of your nx project:
```
> nx test <project-name>
```

## TODO

This just runs simple build and test commands, with no arguments. Eventually, it should support more commands + passing in arguments.