Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/gitpod-protocol/src/snapshot-url.spec.ts
2498 views
1
/**
2
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
* Licensed under the GNU Affero General Public License (AGPL).
4
* See License.AGPL.txt in the project root for license information.
5
*/
6
7
import { suite, test } from "@testdeck/mocha";
8
import * as chai from "chai";
9
import { SnapshotUrl } from ".";
10
11
const expect = chai.expect;
12
13
@suite
14
class TestSnapshotUrlParser {
15
@test public testPositive() {
16
const actual = SnapshotUrl.parse(
17
"workspaces/c362d434-6faa-4ce0-9ad4-91b4a87c4abe/3f0556f7-4afa-11e9-98d5-52f8983b9279.tar@gitpod-prodcopy-user-e1e28f18-0354-4a5d-b6b4-8879a2ff73fd",
18
);
19
20
expect(actual).to.deep.equal(<SnapshotUrl>{
21
bucketId: "gitpod-prodcopy-user-e1e28f18-0354-4a5d-b6b4-8879a2ff73fd",
22
filename: "3f0556f7-4afa-11e9-98d5-52f8983b9279.tar",
23
fullPath: "workspaces/c362d434-6faa-4ce0-9ad4-91b4a87c4abe/3f0556f7-4afa-11e9-98d5-52f8983b9279.tar",
24
});
25
}
26
}
27
module.exports = new TestSnapshotUrlParser(); // Only to circumvent no usage warning :-/
28
29