Upgrade Storybook

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Jamie Kyle 2023-10-11 12:06:43 -07:00 committed by GitHub
parent 8c966dfbd8
commit 502ea174ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
328 changed files with 10863 additions and 12432 deletions

View file

@ -11,25 +11,25 @@ import * as Sinon from 'sinon';
import { writeWindowsZoneIdentifier } from '../../util/windowsZoneIdentifier';
describe('writeWindowsZoneIdentifier', () => {
before(function thisNeeded() {
before(function (this: Mocha.Context) {
if (process.platform !== 'win32') {
this.skip();
}
});
beforeEach(async function thisNeeded() {
beforeEach(async function (this: Mocha.Context) {
this.sandbox = Sinon.createSandbox();
this.tmpdir = await fs.promises.mkdtemp(
path.join(os.tmpdir(), 'signal-test-')
);
});
afterEach(async function thisNeeded() {
afterEach(async function (this: Mocha.Context) {
this.sandbox.restore();
await fse.remove(this.tmpdir);
});
it('writes zone transfer ID 3 (internet) to the Zone.Identifier file', async function thisNeeded() {
it('writes zone transfer ID 3 (internet) to the Zone.Identifier file', async function (this: Mocha.Context) {
const file = path.join(this.tmpdir, 'file.txt');
await fse.outputFile(file, 'hello');
@ -41,7 +41,7 @@ describe('writeWindowsZoneIdentifier', () => {
);
});
it('fails if there is an existing Zone.Identifier file', async function thisNeeded() {
it('fails if there is an existing Zone.Identifier file', async function (this: Mocha.Context) {
const file = path.join(this.tmpdir, 'file.txt');
await fse.outputFile(file, 'hello');
await fs.promises.writeFile(`${file}:Zone.Identifier`, '# already here');
@ -49,13 +49,13 @@ describe('writeWindowsZoneIdentifier', () => {
await assert.isRejected(writeWindowsZoneIdentifier(file));
});
it('fails if the original file does not exist', async function thisNeeded() {
it('fails if the original file does not exist', async function (this: Mocha.Context) {
const file = path.join(this.tmpdir, 'file-never-created.txt');
await assert.isRejected(writeWindowsZoneIdentifier(file));
});
it('fails if not on Windows', async function thisNeeded() {
it('fails if not on Windows', async function (this: Mocha.Context) {
this.sandbox.stub(process, 'platform').get(() => 'darwin');
const file = path.join(this.tmpdir, 'file.txt');