-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: match style of existing codebase
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { MongoClient } from '../mod.ts'; | ||
|
||
for (let x = 0; x < 100000; x++) { | ||
const client = new MongoClient(); | ||
|
||
const url = `mongodb://testadmin1:testpass1@localhost:27017?directConnection=true` | ||
console.log('url:', url); | ||
await client.connect(url); | ||
|
||
await client.close() | ||
console.log(''); | ||
} |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { decodeBase64 } from "../../src/utils/decode_base64.ts"; | ||
|
||
import { assertEquals, describe, it } from "./../test.deps.ts"; | ||
|
||
describe("decodeBase64", () => { | ||
it({ | ||
name: "should correctly decode a standard base64 encoded string", | ||
fn() { | ||
const encoded = "SGVsbG8gV29ybGQ="; // "Hello World" in base64 | ||
const decoded = decodeBase64(encoded); | ||
assertEquals(new TextDecoder().decode(decoded), "Hello World"); | ||
}, | ||
}); | ||
|
||
it({ | ||
name: "should correctly decode a URL-safe base64 encoded string", | ||
fn() { | ||
const encoded = "SGVsbG8tV29ybGRf"; // URL-safe base64 variant | ||
const decoded = decodeBase64(encoded); | ||
assertEquals(new TextDecoder().decode(decoded), "Hello-World_"); | ||
}, | ||
}); | ||
|
||
it({ | ||
name: "should handle base64 strings with missing padding", | ||
fn() { | ||
const encoded = "SGVsbG8gV29ybGQ"; // Missing '=' at the end | ||
const decoded = decodeBase64(encoded); | ||
assertEquals(new TextDecoder().decode(decoded), "Hello World"); | ||
}, | ||
}); | ||
|
||
it({ | ||
name: "should return an empty array for an empty string", | ||
fn() { | ||
const encoded = ""; | ||
const decoded = decodeBase64(encoded); | ||
assertEquals(decoded.length, 0); | ||
}, | ||
}); | ||
}); |