Skip to content

Commit

Permalink
Fix tests so they work locally and in GH
Browse files Browse the repository at this point in the history
  • Loading branch information
jodyheavener committed Feb 24, 2023
1 parent ef9e95c commit bf70465
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,53 @@

exports[`render returns the template json 1`] = `
{
"absoluteFilePath": "/Users/jody/Downloads/Repositories/mjml-testing-library",
"absoluteFilePath": "/",
"attributes": {},
"children": [
{
"absoluteFilePath": "/Users/jody/Downloads/Repositories/mjml-testing-library",
"absoluteFilePath": "/",
"attributes": {},
"children": [
{
"absoluteFilePath": "/Users/jody/Downloads/Repositories/mjml-testing-library",
"absoluteFilePath": "/",
"attributes": {},
"children": [
{
"absoluteFilePath": "/Users/jody/Downloads/Repositories/mjml-testing-library",
"absoluteFilePath": "/",
"attributes": {},
"children": [
{
"absoluteFilePath": "/Users/jody/Downloads/Repositories/mjml-testing-library",
"absoluteFilePath": "/",
"attributes": {
"color": "blue",
"font-size": "10px",
},
"content": "This is some text",
"file": ".",
"file": "/",
"includedIn": [],
"line": 7,
"tagName": "mj-text",
},
],
"file": ".",
"file": "/",
"includedIn": [],
"line": 6,
"tagName": "mj-column",
},
],
"file": ".",
"file": "/",
"includedIn": [],
"line": 5,
"tagName": "mj-section",
},
],
"file": ".",
"file": "/",
"includedIn": [],
"line": 3,
"tagName": "mj-body",
},
],
"file": ".",
"file": "/",
"includedIn": [],
"line": 2,
"tagName": "mjml",
Expand Down
8 changes: 6 additions & 2 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ describe('render', () => {
});

it('returns the template json', () => {
const renderedJson = mjml2html(wrappedTemplate).json;
const renderedJson = mjml2html(wrappedTemplate, {
actualPath: '/',
}).json;

const { json } = render(wrappedTemplate);
const { json } = render(wrappedTemplate, {
mjmlOptions: { actualPath: '/' },
});
expect(json).toStrictEqual(renderedJson);
expect(json).toMatchSnapshot();
});
Expand Down

0 comments on commit bf70465

Please sign in to comment.