blob: 0dfbc455e38e9f2562bcef40adad3c03ddaa8719 (
plain)
| 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
 | /**
 * Matchers for implementing specs. Follows the Jasmine spec conventions.
 */
angular.scenario.matcher('toEqual', function(expected) {
  return angular.equals(this.actual, expected);
});
angular.scenario.matcher('toBeDefined', function() {
  return angular.isDefined(this.actual);
});
angular.scenario.matcher('toBeTruthy', function() {
  return this.actual;
});
angular.scenario.matcher('toBeFalsy', function() {
  return !this.actual;
});
angular.scenario.matcher('toMatch', function(expected) {
  return new RegExp(expected).test(this.actual);
});
angular.scenario.matcher('toBeNull', function() {
  return this.actual === null;
});
angular.scenario.matcher('toContain', function(expected) {
  return includes(this.actual, expected);
});
angular.scenario.matcher('toBeLessThan', function(expected) {
  return this.actual < expected;
});
angular.scenario.matcher('toBeGreaterThan', function(expected) {
  return this.actual > expected;
});
 |