Skip to content

Commit

Permalink
feat: Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
loune committed Dec 28, 2023
1 parent dbd54e4 commit 45e74e1
Show file tree
Hide file tree
Showing 5 changed files with 1,042 additions and 979 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,19 @@
"@azure/storage-blob": "^12.15.0",
"@google-cloud/storage": "^7.0.1",
"@types/jest": "^29.5.1",
"@types/mime": "^3.0.1",
"@types/node": "^14",
"@types/node": "^16",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"azurite": "^3.25.1",
"env-cmd": "^10.1.0",
"eslint": "^8.2.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.5.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-prettier": "^5.1.2",
"jest": "^29.5.0",
"prettier": "^2.1.2",
"prettier": "^3.1.1",
"rimraf": "^5.0.0",
"ts-jest": "^29.1.0",
"typescript": "^5.0.4"
Expand Down
8 changes: 6 additions & 2 deletions src/azure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ test('azure uploadFile', async () => {
});
});

await new Promise((r) => setTimeout(r, 4000));
await new Promise((r) => {
setTimeout(r, 4000);
});

try {
const testFile = 'jest.config.js';
Expand Down Expand Up @@ -102,7 +104,9 @@ test('azure uploadFile', async () => {

await containerClient.delete();
} finally {
spawnSync('kill', ['-9', azurite.pid.toString()]);
if (azurite.pid) {
spawnSync('kill', ['-9', azurite.pid.toString()]);
}
await azuriteEnd;
}
});
24 changes: 18 additions & 6 deletions src/contentType.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,53 @@ test('content type html', async () => {
const filename = `test-html-${Date.now()}`;
const ws = fs.createWriteStream(filename, { encoding: 'utf8', flags: 'as' });
ws.write('<!DOCTYPE html>\n<html></html>');
await new Promise((res) => ws.close(res));
await new Promise((res) => {
ws.close(res);
});

const type = await getFileMimeType(filename);

expect(type).toEqual('text/html');

await new Promise((resolve) => setTimeout(resolve, 1000));
await new Promise((resolve) => {
setTimeout(resolve, 1000);
});
fs.unlinkSync(filename);
});

test('content type not html', async () => {
const filename = `test-nothtml-${Date.now()}`;
const ws = fs.createWriteStream(filename, { encoding: 'utf8', flags: 'as' });
ws.write('<!DOCTYsdfsdfsPE htmdsfdsfdsl>dfdsn<htmsadsfl></html>');
await new Promise((res) => ws.close(res));
await new Promise((res) => {
ws.close(res);
});

const type = await getFileMimeType(filename);

expect(type).toEqual(undefined);

await new Promise((resolve) => setTimeout(resolve, 1000));
await new Promise((resolve) => {
setTimeout(resolve, 1000);
});
fs.unlinkSync(filename);
});

test('content type txt', async () => {
const filename = `test-text-${Date.now()}.txt`;
const ws = fs.createWriteStream(filename, { encoding: 'utf8', flags: 'as' });
ws.write('<!DOCTYPE html>\n<html></html>');
await new Promise((res) => ws.close(res));
await new Promise((res) => {
ws.close(res);
});

const type = await getFileMimeType(filename);

expect(type).toEqual('text/plain');

await new Promise((resolve) => setTimeout(resolve, 1000));
await new Promise((resolve) => {
setTimeout(resolve, 1000);
});
fs.unlinkSync(filename);
});

Expand Down
8 changes: 6 additions & 2 deletions src/push.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,9 @@ test('push with azure', async () => {
});
});

await new Promise((r) => setTimeout(r, 4000));
await new Promise((r) => {
setTimeout(r, 4000);
});

try {
const prefix = `__snap-push-test${Date.now()}/`;
Expand Down Expand Up @@ -598,7 +600,9 @@ test('push with azure', async () => {
// cleanup
await containerClient.delete();
} finally {
spawnSync('kill', ['-9', azurite.pid.toString()]);
if (azurite.pid) {
spawnSync('kill', ['-9', azurite.pid.toString()]);
}
await azuriteEnd;
}
});
Expand Down
Loading

0 comments on commit 45e74e1

Please # to comment.