-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Remove unused outer describe blocks from tests
The practice of wrapping each test file in an outer describe block is not necessary since vitest displays the test file in test results. This commit removes all outer describe blocks that are not used for any other purpose than to group tests in the test results.
- Loading branch information
Showing
21 changed files
with
2,014 additions
and
2,066 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,38 @@ | ||
import crypto from 'node:crypto'; | ||
|
||
import { describe, expect, it } from 'vitest'; | ||
|
||
import { span } from './text.ts'; | ||
|
||
global.crypto ??= (crypto as any).webcrypto; | ||
describe('span', () => { | ||
it('creates text span with given string', () => { | ||
const sp = span('foo'); | ||
|
||
describe('test', () => { | ||
describe('span', () => { | ||
it('creates text span with given string', () => { | ||
const sp = span('foo'); | ||
expect(sp).toEqual({ text: 'foo' }); | ||
}); | ||
|
||
expect(sp).toEqual({ text: 'foo' }); | ||
}); | ||
it('creates text span with given string and props', () => { | ||
const sp = span('foo', { fontStyle: 'italic' }); | ||
|
||
it('creates text span with given string and props', () => { | ||
const sp = span('foo', { fontStyle: 'italic' }); | ||
expect(sp).toEqual({ text: 'foo', fontStyle: 'italic' }); | ||
}); | ||
|
||
expect(sp).toEqual({ text: 'foo', fontStyle: 'italic' }); | ||
}); | ||
it('creates text span with given array and props', () => { | ||
const sp = span(['foo', span('bar', { fontStyle: 'italic' })], { fontSize: 8 }); | ||
|
||
it('creates text span with given array and props', () => { | ||
const sp = span(['foo', span('bar', { fontStyle: 'italic' })], { fontSize: 8 }); | ||
expect(sp).toEqual({ text: ['foo', { text: 'bar', fontStyle: 'italic' }], fontSize: 8 }); | ||
}); | ||
|
||
expect(sp).toEqual({ text: ['foo', { text: 'bar', fontStyle: 'italic' }], fontSize: 8 }); | ||
}); | ||
it('extracts a single array element in text', () => { | ||
const sp = span(['foo'], { fontStyle: 'italic' }); | ||
|
||
it('extracts a single array element in text', () => { | ||
const sp = span(['foo'], { fontStyle: 'italic' }); | ||
expect(sp).toEqual({ text: 'foo', fontStyle: 'italic' }); | ||
}); | ||
|
||
expect(sp).toEqual({ text: 'foo', fontStyle: 'italic' }); | ||
it('merges a single text span in text, inner span takes precedence', () => { | ||
const sp = span(span('foo', { fontWeight: 'bold' }), { | ||
fontStyle: 'italic', | ||
fontWeight: 'normal', | ||
}); | ||
|
||
it('merges a single text span in text, inner span takes precedence', () => { | ||
const sp = span(span('foo', { fontWeight: 'bold' }), { | ||
fontStyle: 'italic', | ||
fontWeight: 'normal', | ||
}); | ||
|
||
expect(sp).toEqual({ text: 'foo', fontWeight: 'bold', fontStyle: 'italic' }); | ||
}); | ||
expect(sp).toEqual({ text: 'foo', fontWeight: 'bold', fontStyle: 'italic' }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.