Skip to content

Commit

Permalink
Add a test for default exports from preact/compat/client
Browse files Browse the repository at this point in the history
  • Loading branch information
Verseth committed Oct 29, 2022
1 parent 80dd66c commit 50d3837
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions compat/test/browser/exports.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import Compat from 'preact/compat';
import CompatClient from 'preact/compat/client';
// eslint-disable-next-line no-duplicate-imports
import * as Named from 'preact/compat';
// eslint-disable-next-line no-duplicate-imports
import * as NamedClient from 'preact/compat/client';

describe('compat exports', () => {
describe('client', () => {
it('should have a default export', () => {
expect(CompatClient.createRoot).to.be.a('function');
expect(CompatClient.hydrateRoot).to.be.a('function');
});

it('should have named exports', () => {
expect(NamedClient.createRoot).to.be.a('function');
expect(NamedClient.hydrateRoot).to.be.a('function');
});
});

it('should have a default export', () => {
expect(Compat.createElement).to.be.a('function');
expect(Compat.Component).to.be.a('function');
Expand Down

0 comments on commit 50d3837

Please sign in to comment.