Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding react-dom as a peer dependency #91

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading