Skip to content

Commit

Permalink
Adding react-dom as a peer dependency (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
cohitre committed Apr 19, 2024
1 parent 7d9bb07 commit 1245bda
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
transformIgnorePatterns: ['/node_modules/(?!(@usewaypoint)/)'],
transform: {
'^.+\\.(js|jsx|ts|tsx|mjs)$': 'ts-jest',
},
};

export default config;
23 changes: 23 additions & 0 deletions packages/email-builder/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/email-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "React component to render email messages",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"target": "ES2022",
"files": [
"dist"
],
Expand All @@ -15,6 +14,7 @@
"license": "MIT",
"peerDependencies": {
"react": "^16 || ^17 || ^18",
"react-dom": "^16 || ^17 || ^18",
"zod": "^1 || ^2 || ^3"
},
"dependencies": {
Expand Down
24 changes: 24 additions & 0 deletions packages/email-builder/src/renderers/renderToStaticMarkup.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @jest-environment node
*/

import renderToStaticMarkup from './renderToStaticMarkup';

describe('renderToStaticMarkup', () => {
it.only('renders into a string', () => {
const result = renderToStaticMarkup(
{
root: {
type: 'Container',
data: {
props: {
childrenIds: [],
},
},
},
},
{ rootBlockId: 'root' }
);
expect(result).toEqual('<!DOCTYPE html><html><body><div></div></body></html>');
});
});
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"jsx": "react",
"strict": true,
"sourceMap": true,
"allowJs": true,
"esModuleInterop": true,

"skipLibCheck": true,
Expand Down

0 comments on commit 1245bda

Please sign in to comment.