How to use the jest-editor-support.Snapshot function in jest-editor-support

To help you get started, we’ve selected a few jest-editor-support examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jest-community / vscode-jest / src / SnapshotCodeLens / SnapshotCodeLensProvider.ts View on Github external
public provideCodeLenses(document: vscode.TextDocument, _token: vscode.CancellationToken) {
    const snapshots = new Snapshot()
    return snapshots.getMetadata(document.uri.fsPath).map(snapshot => {
      const { line } = snapshot.node.loc.start
      const range = new vscode.Range(line - 1, 0, line - 1, 0)
      let command: vscode.Command
      if (snapshot.exists) {
        command = {
          title: 'view snapshot',
          command: previewCommand,
          arguments: [snapshot],
        }
      } else {
        command = {
          title: 'snapshot missing',
          command: missingSnapshotCommand,
        }
      }

jest-editor-support

[![Build Status](https://github.com/jest-community/jest-editor-support/actions/workflows/node-ci.yml/badge.svg)](https://github.com/jest-community/jest-editor-support/actions) [![Coverage Status](https://coveralls.io/repos/github/jest-community/jest-edito

MIT
Latest version published 2 months ago

Package Health Score

72 / 100
Full package analysis

Similar packages