mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 16:29:47 +02:00
test: enable a few jest eslint rules (#6900)
* test: enable a few jest eslint rules * more
This commit is contained in:
parent
1efc6c6091
commit
aa5a2d4c04
155 changed files with 3644 additions and 3478 deletions
|
@ -1,6 +1,6 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`npm2yarn plugin test: already imported tabs components above are not re-imported 1`] = `
|
||||
exports[`npm2yarn plugin does not re-import tabs components when already imported above 1`] = `
|
||||
"import Tabs from '@theme/Tabs';
|
||||
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
@ -24,7 +24,7 @@ import TabItem from '@theme/TabItem';
|
|||
"
|
||||
`;
|
||||
|
||||
exports[`npm2yarn plugin test: already imported tabs components below are not re-imported 1`] = `
|
||||
exports[`npm2yarn plugin tdoes not re-import tabs components when already imported below 1`] = `
|
||||
"<Tabs>
|
||||
<TabItem value=\\"npm\\">
|
||||
|
||||
|
@ -48,7 +48,7 @@ import TabItem from '@theme/TabItem';
|
|||
"
|
||||
`;
|
||||
|
||||
exports[`npm2yarn plugin test: installation file 1`] = `
|
||||
exports[`npm2yarn plugin works on installation file 1`] = `
|
||||
"import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
|
@ -71,22 +71,7 @@ import TabItem from '@theme/TabItem';
|
|||
"
|
||||
`;
|
||||
|
||||
exports[`npm2yarn plugin test: language was not set 1`] = `
|
||||
"\`\`\`npm2yarn
|
||||
npm install --save docusaurus-plugin-name
|
||||
\`\`\`
|
||||
|
||||
\`\`\`bash
|
||||
npm install --save docusaurus-plugin-name
|
||||
\`\`\`
|
||||
|
||||
\`\`\`shell
|
||||
npm install --save docusaurus-plugin-name
|
||||
\`\`\`
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`npm2yarn plugin test: plugin file 1`] = `
|
||||
exports[`npm2yarn plugin works on plugin file 1`] = `
|
||||
"import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
|
@ -112,3 +97,18 @@ yarn add docusaurus-plugin-name
|
|||
</Tabs>
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`npm2yarn plugin works when language is not set 1`] = `
|
||||
"\`\`\`npm2yarn
|
||||
npm install --save docusaurus-plugin-name
|
||||
\`\`\`
|
||||
|
||||
\`\`\`bash
|
||||
npm install --save docusaurus-plugin-name
|
||||
\`\`\`
|
||||
|
||||
\`\`\`shell
|
||||
npm install --save docusaurus-plugin-name
|
||||
\`\`\`
|
||||
"
|
||||
`;
|
||||
|
|
|
@ -25,31 +25,31 @@ const processFixture = async (name: string, options?: {sync?: boolean}) => {
|
|||
};
|
||||
|
||||
describe('npm2yarn plugin', () => {
|
||||
test('test: installation file', async () => {
|
||||
it('works on installation file', async () => {
|
||||
const result = await processFixture('installation');
|
||||
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('test: plugin file', async () => {
|
||||
it('works on plugin file', async () => {
|
||||
const result = await processFixture('plugin');
|
||||
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('test: language was not set', async () => {
|
||||
it('works when language is not set', async () => {
|
||||
const result = await processFixture('syntax-not-properly-set');
|
||||
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('test: already imported tabs components above are not re-imported', async () => {
|
||||
it('does not re-import tabs components when already imported above', async () => {
|
||||
const result = await processFixture('import-tabs-above');
|
||||
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('test: already imported tabs components below are not re-imported', async () => {
|
||||
it('tdoes not re-import tabs components when already imported below', async () => {
|
||||
const result = await processFixture('import-tabs-below');
|
||||
|
||||
expect(result).toMatchSnapshot();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue