Skip to content

Commit

Permalink
Mocha test fixes (#947)
Browse files Browse the repository at this point in the history
* fix: add babel/preset-react for react projects

* fix: common lint catches
  • Loading branch information
agerard-godaddy authored Oct 17, 2024
1 parent 8c95c49 commit 9e19300
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/gasket-plugin-mocha/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ const plugin = {

pkg.add('devDependencies', {
// All dependencies to correctly configure React Testing Library
'jsdom': devDependencies.jsdom,
'@babel/preset-react': devDependencies['@babel/preset-react'],
'@testing-library/react': devDependencies['@testing-library/react'],
'jsdom': devDependencies.jsdom,
'global-jsdom': devDependencies['global-jsdom'],
[name]: `^${version}`
});
Expand Down
3 changes: 2 additions & 1 deletion packages/gasket-plugin-mocha/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ describe('Plugin', () => {
});

[
'global-jsdom',
'@babel/preset-react',
'@testing-library/react',
'global-jsdom',
'jsdom'
].forEach(name => {
it(`adds "${name}" in the devDependencies`, async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('IndexPage', () => {
it('renders page', () => {
render(
{{#if hasGasketIntl}}
<IntlProvider locale={'en-US'} messages={messages}>
<IntlProvider locale={ 'en-US' } messages={ messages }>
{{/if}}
<IndexPage />
{{#if hasGasketIntl}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('IndexPage', () => {
it('renders page', () => {
render(
{{#if hasGasketIntl}}
<IntlProvider locale={'en-US'} messages={messages}>
<IntlProvider locale={ 'en-US' } messages={ messages }>
{{/if}}
<IndexPage />
{{#if hasGasketIntl}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('IndexPage', () => {
it('renders page', () => {
render(
{{#if hasGasketIntl}}
<IntlProvider locale={'en-US'} messages={messages}>
<IntlProvider locale={ 'en-US' } messages={ messages }>
{{/if}}
<IndexPage />
{{#if hasGasketIntl}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('IndexPage', () => {
it('renders page', () => {
render(
{{#if hasGasketIntl}}
<IntlProvider locale={'en-US'} messages={messages}>
<IntlProvider locale={ 'en-US' } messages={ messages }>
{{/if}}
<IndexPage />
{{#if hasGasketIntl}}
Expand Down

0 comments on commit 9e19300

Please sign in to comment.