-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathurlBack.test.js
More file actions
30 lines (26 loc) · 851 Bytes
/
Copy pathurlBack.test.js
File metadata and controls
30 lines (26 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import urlBack from "./urlBack.es6.js"
import checkFile from "check-ecmascript-version-compatibility";
describe('compability check', function () {
it('es6 compliant', (done) => {
function callback(data) {
try {
expect(data).toBe(undefined);
done();
} catch (error) {
done(error);
}
}
checkFile('./src/urlBack/urlBack.es6.js', 2015, callback)
});
});
describe('basic check', () => {
test('should go back', () => {
expect(urlBack("https://en.wikipedia.org/wiki/ECMAScript")).toBe("https://en.wikipedia.org/wiki");
});
test('should go back (trailing slash)', () => {
expect(urlBack("https://en.wikipedia.org/")).toBe("https://en.wikipedia.org");
});
test('no previous path', () => {
expect(urlBack("https://en.wikipedia.org")).toBe("https://en.wikipedia.org");
});
});