We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4491e47 commit 27d3364Copy full SHA for 27d3364
1 file changed
test/specs/util/url.spec.js
@@ -0,0 +1,24 @@
1
+"use strict";
2
+
3
+const chai = require("chai");
4
+const chaiSubset = require("chai-subset");
5
+chai.use(chaiSubset);
6
+const { expect } = chai;
7
+const $url = require("../../../lib/util/url");
8
9
+describe("Return the extension of a URL", () => {
10
+ it("should return an empty string if there isn't any extension", async () => {
11
+ const extension = $url.getExtension("/file");
12
+ expect(extension).to.equal("");
13
+ });
14
15
+ it("should return the extension in lowercase", async () => {
16
+ const extension = $url.getExtension("/file.YML");
17
+ expect(extension).to.equal(".yml");
18
19
20
+ it("should return the extension without the query", async () => {
21
+ const extension = $url.getExtension("/file.yml?foo=bar");
22
23
24
+});
0 commit comments