Move spec out of src
parent
cecb92bb9f
commit
56be88ed41
|
@ -2,4 +2,6 @@ node_modules/
|
||||||
dist/
|
dist/
|
||||||
dist-es/
|
dist-es/
|
||||||
bundle.js
|
bundle.js
|
||||||
/src/data/data.js
|
stats.json
|
||||||
|
report.html
|
||||||
|
/src/data/data.js
|
||||||
|
|
|
@ -3,6 +3,7 @@ scripts/
|
||||||
.*
|
.*
|
||||||
|
|
||||||
src/
|
src/
|
||||||
|
spec/
|
||||||
example/
|
example/
|
||||||
karma.conf.js
|
karma.conf.js
|
||||||
yarn.lock
|
yarn.lock
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Karma configuration
|
// Karma configuration
|
||||||
// Generated on Fri Jan 27 2017 13:33:03 GMT-0700 (MST)
|
// Generated on Fri Jan 27 2017 13:33:03 GMT-0700 (MST)
|
||||||
var webpackConfig = require('./src/webpack.config.js');
|
var webpackConfig = require('./spec/webpack.config.js');
|
||||||
|
|
||||||
module.exports = function(config) {
|
module.exports = function(config) {
|
||||||
config.set({
|
config.set({
|
||||||
|
@ -16,7 +16,7 @@ module.exports = function(config) {
|
||||||
|
|
||||||
// list of files / patterns to load in the browser
|
// list of files / patterns to load in the browser
|
||||||
files: [
|
files: [
|
||||||
'src/**/*Spec.js',
|
'spec/*spec.js',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ module.exports = function(config) {
|
||||||
// preprocess matching files before serving them to the browser
|
// preprocess matching files before serving them to the browser
|
||||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
'src/**/*Spec.js': ['webpack'],
|
'spec/*spec.js': ['webpack'],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
10
package.json
10
package.json
|
@ -64,12 +64,12 @@
|
||||||
"clean": "rm -rf dist/ dist-es/ src/data/data.js",
|
"clean": "rm -rf dist/ dist-es/ src/data/data.js",
|
||||||
"build:data": "node scripts/build-data",
|
"build:data": "node scripts/build-data",
|
||||||
"build:dist": "npm run build:cjs && npm run build:es",
|
"build:dist": "npm run build:cjs && npm run build:es",
|
||||||
"build:cjs": "BABEL_ENV=cjs babel src --out-dir dist --copy-files --ignore webpack.config.js",
|
"build:cjs": "BABEL_ENV=cjs babel src --out-dir dist --copy-files",
|
||||||
"build:es": "babel src --out-dir dist-es --copy-files --ignore webpack.config.js",
|
"build:es": "babel src --out-dir dist-es --copy-files",
|
||||||
"build": "npm run clean && npm run build:data && npm run build:dist",
|
"build": "npm run clean && npm run build:data && npm run build:dist",
|
||||||
"watch": "BABEL_ENV=cjs babel src --watch --out-dir dist --copy-files --ignore webpack.config.js",
|
"watch": "BABEL_ENV=cjs babel src --watch --out-dir dist --copy-files",
|
||||||
"start": "npm run watch",
|
"start": "npm run watch",
|
||||||
"stats": "webpack --config ./src/webpack.config.js --json > stats.json",
|
"stats": "webpack --config ./spec/webpack.config.js --json > spec/stats.json",
|
||||||
"react:clean": "rimraf node_modules/{react,react-dom,react-addons-test-utils}",
|
"react:clean": "rimraf node_modules/{react,react-dom,react-addons-test-utils}",
|
||||||
"react:14": "npm run react:clean && npm i react@^0.14 react-dom@^0.14 react-addons-test-utils@^0.14 --save-dev",
|
"react:14": "npm run react:clean && npm i react@^0.14 react-dom@^0.14 react-addons-test-utils@^0.14 --save-dev",
|
||||||
"react:15": "npm run react:clean && npm i react@^15 react-dom@^15 react-addons-test-utils@^15 --save-dev",
|
"react:15": "npm run react:clean && npm i react@^15 react-dom@^15 react-addons-test-utils@^15 --save-dev",
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"storybook": "start-storybook -p 6006",
|
"storybook": "start-storybook -p 6006",
|
||||||
"build-storybook": "build-storybook",
|
"build-storybook": "build-storybook",
|
||||||
"prettier": "prettier --no-semi --single-quote --trailing-comma es5 --write \"src/**/*.js\""
|
"prettier": "prettier --no-semi --single-quote --trailing-comma es5 --write \"{src,spec}/**/*.js\""
|
||||||
},
|
},
|
||||||
"size-limit": [
|
"size-limit": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import emojiIndex from './emoji-index'
|
import emojiIndex from '../src/utils/emoji-index'
|
||||||
|
|
||||||
describe('#emojiIndex', () => {
|
describe('#emojiIndex', () => {
|
||||||
describe('search', function() {
|
describe('search', function() {
|
||||||
|
@ -17,7 +17,9 @@ describe('#emojiIndex', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should filter only emojis we care about, exclude pineapple', () => {
|
it('should filter only emojis we care about, exclude pineapple', () => {
|
||||||
let emojisToShowFilter = (data) => { data.unified !== '1F34D' }
|
let emojisToShowFilter = data => {
|
||||||
|
data.unified !== '1F34D'
|
||||||
|
}
|
||||||
expect(
|
expect(
|
||||||
emojiIndex.search('apple', { emojisToShowFilter }).map(obj => obj.id)
|
emojiIndex.search('apple', { emojisToShowFilter }).map(obj => obj.id)
|
||||||
).not.toContain('pineapple')
|
).not.toContain('pineapple')
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import TestUtils from 'react-dom/test-utils'
|
import TestUtils from 'react-dom/test-utils'
|
||||||
import Picker from './picker'
|
import Picker from '../src/components/picker'
|
||||||
|
|
||||||
const { click } = TestUtils.Simulate
|
const { click } = TestUtils.Simulate
|
||||||
|
|
||||||
|
@ -10,6 +10,11 @@ const {
|
||||||
findRenderedComponentWithType,
|
findRenderedComponentWithType,
|
||||||
} = TestUtils
|
} = TestUtils
|
||||||
|
|
||||||
|
const render = (props = {}) => {
|
||||||
|
const defaultProps = {}
|
||||||
|
return renderIntoDocument(<Picker {...defaultProps} {...props} />)
|
||||||
|
}
|
||||||
|
|
||||||
describe('Picker', () => {
|
describe('Picker', () => {
|
||||||
let subject
|
let subject
|
||||||
|
|
||||||
|
@ -29,9 +34,4 @@ describe('Picker', () => {
|
||||||
expect(subject.categories.length).toEqual(2)
|
expect(subject.categories.length).toEqual(2)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
function render(props = {}) {
|
|
||||||
const defaultProps = {}
|
|
||||||
return renderIntoDocument(<Picker {...defaultProps} {...props} />)
|
|
||||||
}
|
|
||||||
})
|
})
|
|
@ -10,8 +10,8 @@ var TEST = process.env.NODE_ENV === 'test'
|
||||||
var config = {
|
var config = {
|
||||||
entry: path.resolve('src/index.js'),
|
entry: path.resolve('src/index.js'),
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve('dist'),
|
path: path.resolve('spec'),
|
||||||
filename: 'emoji-mart.js',
|
filename: 'bundle.js',
|
||||||
library: 'EmojiMart',
|
library: 'EmojiMart',
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
},
|
},
|
||||||
|
@ -23,22 +23,7 @@ var config = {
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
use: 'babel-loader',
|
use: 'babel-loader',
|
||||||
include: [path.resolve('src'), path.resolve('data')],
|
include: [path.resolve('src'), path.resolve('spec')],
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.svg$/,
|
|
||||||
use: [
|
|
||||||
{
|
|
||||||
loader: 'babel-loader',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
loader: 'svg-jsx-loader',
|
|
||||||
options: {
|
|
||||||
es6: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
include: [path.resolve('src/svgs')],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
Loading…
Reference in New Issue