Skip to content

Commit

Permalink
Alpha (#1)
Browse files Browse the repository at this point in the history
Alpha
  • Loading branch information
travi authored Jan 6, 2020
2 parents e036346 + 3670fb5 commit 8550a58
Show file tree
Hide file tree
Showing 38 changed files with 2,282 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"presets":["@travi"],"ignore":["./lib/"]}
{"presets":[["@travi", {"react": true}]],"ignore":["./lib/"]}
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/lib/
/coverage/
/coverage/
/storybook-static/
/cypress/
6 changes: 5 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
extends:
- '@travi'
- '@travi/mocha'
- '@travi/react'
- '@travi/react'

overrides:
- files: 'test/integration/*-spec.js'
extends: '@travi/cypress'
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/node_modules/
/lib/
/storybook-static/
/cypress/videos/
/cypress/fixtures/
/coverage/
/.nyc_output/

.eslintcache
.eslintcache
2 changes: 1 addition & 1 deletion .nycrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"reporter":["lcov","text-summary","html"],"exclude":["src/**/*-test.js","test/","thirdparty-wrappers/","vendor/"]}
{"reporter":["lcov","text-summary","html"],"exclude":["src/**/*-test.js","test/","thirdparty-wrappers/","vendor/","src/theme.js","**/styles.js"]}
4 changes: 4 additions & 0 deletions .storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{"presets": [
["@travi", {"targets": {"browser": true}, "react": true, "modules": false}],
"@emotion/babel-preset-css-prop"
]}
16 changes: 16 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
import {configure} from '@storybook/react';
import {useMediaQuery} from '@material-ui/core';
import {MuiThemeProvider} from '@material-ui/core/styles';
import {addDecorator} from '@storybook/react';
import createTheme from '../src/theme';

const Wrapper = ({story}) => {
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');

return (
<MuiThemeProvider theme={createTheme(prefersDarkMode ? 'dark' : 'light')}>
{story()}
</MuiThemeProvider>
);
};

addDecorator(story => <Wrapper story={story} />);

configure(require.context('../src', true, /stories\.js$/), module);
2 changes: 2 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Permanent+Marker:regular&text=Travi" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />
4 changes: 4 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"integrationFolder": "test/integration",
"baseUrl": "http://localhost:8888"
}
17 changes: 17 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
27 changes: 27 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

import '@testing-library/cypress/add-commands';
20 changes: 20 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading

0 comments on commit 8550a58

Please sign in to comment.