Skip to content

Commit

Permalink
chore(deps-dev): bumping out of date deps
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Sep 1, 2023
1 parent 780fe7d commit 60eec86
Show file tree
Hide file tree
Showing 7 changed files with 2,853 additions and 1,758 deletions.
6 changes: 5 additions & 1 deletion __tests__/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "@readme/eslint-config/testing"
"extends": [
"@readme/eslint-config/testing/jest",
"@readme/eslint-config/testing/jest-dom",
"@readme/eslint-config/testing/react"
]
}
24 changes: 12 additions & 12 deletions __tests__/codeMirror.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test('should highlight a block of code', () => {

expect(code.hasClass('cm-s-neo')).toBe(true);
expect(code.html()).toBe(
'<div class="cm-s-neo"><span class="cm-keyword">var</span> <span class="cm-def">a</span> <span class="cm-operator">=</span> <span class="cm-number">1</span>;</div>'
'<div class="cm-s-neo"><span class="cm-keyword">var</span> <span class="cm-def">a</span> <span class="cm-operator">=</span> <span class="cm-number">1</span>;</div>',
);
});

Expand All @@ -38,7 +38,7 @@ test('should concat the same style items', () => {

test('should work with modes', () => {
expect(shallow(syntaxHighlighter('{ "a": 1 }', 'json')).html()).toBe(
'<div class="cm-s-neo">{ <span class="cm-property">&quot;a&quot;</span>: <span class="cm-number">1</span> }</div>'
'<div class="cm-s-neo">{ <span class="cm-property">&quot;a&quot;</span>: <span class="cm-number">1</span> }</div>',
);
});

Expand All @@ -47,29 +47,29 @@ test('should keep trailing json bracket if highlightMode is enabled', () => {
shallow(
syntaxHighlighter('{ "a": 1 }', 'json', {
highlightMode: true,
})
).html()
}),
).html(),
).toBe(
'<div class="cm-s-neo CodeEditor"><div class="CodeMirror"><div class="cm-linerow "><span class="cm-lineNumber">1</span>{ <span class="cm-property">&quot;a&quot;</span>: <span class="cm-number">1</span> }</div></div></div>'
'<div class="cm-s-neo CodeEditor"><div class="CodeMirror"><div class="cm-linerow "><span class="cm-lineNumber">1</span>{ <span class="cm-property">&quot;a&quot;</span>: <span class="cm-number">1</span> }</div></div></div>',
);
});

test('should have a dark theme', () => {
expect(shallow(syntaxHighlighter('{ "a": 1 }', 'json', { dark: true })).hasClass('cm-s-material-palenight')).toBe(
true
true,
);
});

describe('variable substitution', () => {
it('should tokenize variables (double quotes)', () => {
expect(mount(syntaxHighlighter('"<<apiKey>>"', 'json', { tokenizeVariables: true })).find(Variable)).toHaveLength(
1
1,
);
});

it('should tokenize variables (single quotes)', () => {
expect(mount(syntaxHighlighter("'<<apiKey>>'", 'json', { tokenizeVariables: true })).find(Variable)).toHaveLength(
1
1,
);
});

Expand All @@ -94,7 +94,7 @@ describe('variable substitution', () => {

it('should tokenize multiple variables per line', () => {
expect(mount(syntaxHighlighter('<<apiKey>> <<name>>', 'json', { tokenizeVariables: true })).text()).toBe(
'APIKEY NAME'
'APIKEY NAME',
);
});

Expand Down Expand Up @@ -195,7 +195,7 @@ describe('highlight mode', () => {
{ ch: 0, line: 1 },
],
],
})
}),
);
});

Expand Down Expand Up @@ -233,7 +233,7 @@ describe('runmode', () => {
{ ch: 0, line: 1 },
],
],
})
}),
);
});

Expand Down Expand Up @@ -265,7 +265,7 @@ describe('code folding', () => {

it('relevant options in the props matches snapshot', () => {
const { options } = shallow(
syntaxHighlighter('{ "a": { "b": { "c": 1 } }', 'json', { foldGutter: true, readOnly: true })
syntaxHighlighter('{ "a": { "b": { "c": 1 } }', 'json', { foldGutter: true, readOnly: true }),
).props();
expect(options).toMatchSnapshot();
});
Expand Down
Loading

0 comments on commit 60eec86

Please sign in to comment.