forked from firefox-devtools/debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframework.spec.js
More file actions
51 lines (41 loc) · 1.56 KB
/
Copy pathframework.spec.js
File metadata and controls
51 lines (41 loc) · 1.56 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
import { getFramework } from "../frameworks";
import { getSource, getOriginalSource } from "./helpers";
import { setSource } from "../sources";
describe("Parser.frameworks", () => {
it("is undefined when no framework", () => {
const source = getOriginalSource("frameworks/plainJavascript");
setSource(source);
expect(getFramework(source.id)).toBeUndefined();
});
// React
it("recognizes ES6 React component", () => {
const source = getOriginalSource("frameworks/reactComponent");
setSource(source);
expect(getFramework(source.id)).toBe("React");
});
it("recognizes ES5 React component", () => {
const source = getSource("frameworks/reactComponentEs5");
setSource(source);
expect(getFramework(source.id)).toBe("React");
});
// Angular
it("recognizes Angular 1 module", () => {
const source = getOriginalSource("frameworks/angular1Module");
setSource(source);
expect(getFramework(source.id)).toBe("Angular");
});
// Vue
it("recognizes declarative Vue file", () => {
const source = getOriginalSource("frameworks/vueFileDeclarative");
setSource(source);
expect(getFramework(source.id)).toBe("Vue");
});
it("recognizes component Vue file", () => {
const source = getOriginalSource("frameworks/vueFileComponent");
setSource(source);
expect(getFramework(source.id)).toBe("Vue");
});
});