Skip to content

Can we use this lib with react-scripts without ejecting? #7

@nicgirault

Description

@nicgirault

My challenge right now is to use this lib within my react app (that is using react-scripts without ejecting).

I would love to be able to write something like this:

title.js

import React from 'react'

export default function Title ({ text }) {
  return <h1>{text}</h1>
}

title.vrtest.js

import React from 'react'
import Title from './title'

export default function TitleExample () {
  return <Title text='This is a title' />
}

vrtest.config.js

const path = require('path');

module.exports = {
  tests: 'src/**/*.vrtest.js',
  storage: {
    baseline: path.resolve(__dirname, './screenshots/reference'),
    output: path.resolve(__dirname, './screenshots/output'),
  },
  selenium: {
    server: 'http://hub-cloud.browserstack.com/wd/hub',
  },
  profiles: [
    {
      name: 'chrome',
      desiredCapabilities: {
        'browserName' : 'Chrome',
        'browser_version' : '62.0',
        'os' : 'Windows',
        'os_version' : '10',
        'resolution' : '1024x768',
        'browserstack.user' : 'xxx',
        'browserstack.key' : 'xxx'
       },
    },
  ],
};

I guess it would mean to have an internal webpack config and this might not be a good idea since it can generate differences between the way to build the app on production and in test env. What do you think about it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions