Giter Site home page Giter Site logo

cbarrerah / jest-editor-support Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jest-community/jest-editor-support

0.0 0.0 0.0 1.3 MB

A module for handling editor to jest integration

License: MIT License

Shell 0.03% JavaScript 62.91% TypeScript 37.06%

jest-editor-support's Introduction

jest-editor-support

Build Status Coverage Status npm version

The engine that allows editors to build on top of Jest.

Usage

This is only useful if you are interested in building an editor integration for Jest.

API

parse(   
  filePath: string,   
  serializedData?: string,   
  options?: JESParserOptions
);

JESParserOptions = 
{
    plugins?: JESParserPluginOptions;
    strictMode?: boolean;
};

JESParserPluginOptions = 
{
  decorators?: 'legacy' | {
    decoratorsBeforeExport?: boolean;
    allowCallParenthesized?: boolean;
  }
}

Parse is a static Jest parser which uses Babel 7 and supports js,jsx,mjs,ts,tsx files.

Supported ECMAScript proposals

  • filePath = Path to the file you want to parse.
  • serializedData = Serialized data, will be used instead of the filePath if available (optional).
  • options:
    • strictMode = If this option is activated the parser throws an exception if the filetype is not detected, defaults to false.
    • pluginOptions = allow override for selected plugins options. Currently only support decorators.

examples:

parse('test.spec.ts');
parse('parameterDecorators.spec.ts', undefined, {plugins: {decorators: 'legacy'}})
parse('parameterDecorators.spec.ts', undefined, 
  {plugins: 
    {decorators: 
      {decoratorsBeforeExport: false}
    }
  })

Note

Since version 18.2.0 TypeScript is now a peer dependency. If you don't need to handle .tsx files then you can safely ignore the warning during installation.

jest-editor-support's People

Contributors

connectdotz avatar dependabot[bot] avatar orta avatar stephtr avatar seanpoulter avatar rossknudsen avatar simenb avatar ehaynes99 avatar thesench avatar xlarsx avatar nithinpeter avatar pmcelhaney avatar firsttris avatar jmarceli avatar mjamin avatar omjadas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.