Skip to content

Commit

Permalink
Failing tests fix; js_only.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolad committed Apr 20, 2020
1 parent 6548f1f commit 440bbe5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
4 changes: 3 additions & 1 deletion assets/src/application/services/utilities/date/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ const diff = (
dirtyOptions?: DirtyOptions
): number => {
const func = diffMapping[unit];
const diffOutput = unit === 'calendarWeeks' ? func(dateLeft, dateRight, dirtyOptions) : func(dateLeft, dateRight);

return unit === 'calendarWeeks' ? func(dateLeft, dateRight, dirtyOptions) : func(dateLeft, dateRight);
// Prevents from having two zeros: -0 and 0; more info here: https://2ality.com/2012/03/signedzero.html
return Number(diffOutput.toString());
};

export default diff;
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe('useFetchPrices', () => {

await waitForNextUpdate({ timeout }); // wait for response

expect(result.current.error).toBeDefined();
expect(result.current.data).toBeUndefined();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe('useFetchTickets', () => {

await waitForChange(() => result.current, { timeout }); // wait for response

expect(result.current.error).toBeDefined();
expect(result.current.data).toBeUndefined();
});

Expand Down
11 changes: 1 addition & 10 deletions config/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const rulesConfig = {
loader: 'postcss-loader',
options: {
// eslint-disable-next-line object-shorthand
plugins: function() {
plugins: function () {
return [autoprefixer, cssnano({ preset: 'default' })];
},
sourceMap: true,
Expand Down Expand Up @@ -211,15 +211,6 @@ const config = [
poll: 1000,
},
},
{
entry: {
'eventespresso-core-css-default': pathToEDTRv1 + 'components/ui/styles/themes/default/index.js',
},
module: moduleConfigWithJsAndCssRules,
watchOptions: {
poll: 1000,
},
},
];

const enhance = (conf) => {
Expand Down

0 comments on commit 440bbe5

Please sign in to comment.