Skip to content

Commit

Permalink
duplicate REGENERATE_METHOD constant in RHL, #807
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Jan 21, 2018
1 parent 23aa1dc commit 16ec309
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-hot-loader/src/babel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { REGENERATE_METHOD } = require('react-stand-in')
import { REGENERATE_METHOD } from './internal/constants'

const templateOptions = {
placeholderPattern: /^([A-Z0-9]+)([A-Z0-9_]+)$/,
Expand Down
3 changes: 3 additions & 0 deletions packages/react-hot-loader/src/internal/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// the same as before
const PREFIX = '__reactstandin__'
export const REGENERATE_METHOD = `${PREFIX}regenerateByEval`
8 changes: 8 additions & 0 deletions packages/react-hot-loader/test/build.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { REGENERATE_METHOD as REGENERATE_METHOD_rhl } from '../src/internal/constants'
import { REGENERATE_METHOD as REGENERATE_METHOD_std } from 'react-stand-in'

describe('Consistency tests', () => {
it('Should be constant con', () => {
expect(REGENERATE_METHOD_rhl).toBe(REGENERATE_METHOD_std)
})
})

0 comments on commit 16ec309

Please sign in to comment.