Skip to content

Document ES7 configuration with babel for ava #513

@ghost

Description

The documentation includes information on how to get ES6 support for ava, which is great. Would it be possible to include docs on how to get ES7 in also?

Here's a realistic use case:

A React component with the @connect() decorator from Redux:

import React from 'react';
import { connect } from 'react-redux';

@connect()
class Foo extends React.Component {

}

A test file for unit testing it:

import test from 'ava';
import { isElementOfType } from 'react-addons-test-utils';
import 'babel-core/register'; // as per docs

var Foo = require('../src/foo.jsx');

test('foo ', t => {
  const simpleFoo = React.createElement(Foo);
  t.ok(isElementOfType(Foo, simpleFoo));
});

I tried using a shim that apparently worked for people back when iojs was separate, but the namespaces don't match anymore:

require("babel/register")({
  optional: ['es7.asyncFunctions']
});

On the other hand, this guy claims ava supports es7 without any extra effort.

Either way, it would be nice to get some documentation on this--I'm interested in using ava going forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions