Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jestExpect.js 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _expect = _interopRequireDefault(require('expect'));
  7. var _jestSnapshot = require('jest-snapshot');
  8. function _interopRequireDefault(obj) {
  9. return obj && obj.__esModule ? obj : {default: obj};
  10. }
  11. /**
  12. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  13. *
  14. * This source code is licensed under the MIT license found in the
  15. * LICENSE file in the root directory of this source tree.
  16. */
  17. /* eslint-disable local/prefer-spread-eventually */
  18. var _default = config => {
  19. global.expect = _expect.default;
  20. _expect.default.setState({
  21. expand: config.expand
  22. });
  23. _expect.default.extend({
  24. toMatchInlineSnapshot: _jestSnapshot.toMatchInlineSnapshot,
  25. toMatchSnapshot: _jestSnapshot.toMatchSnapshot,
  26. toThrowErrorMatchingInlineSnapshot:
  27. _jestSnapshot.toThrowErrorMatchingInlineSnapshot,
  28. toThrowErrorMatchingSnapshot: _jestSnapshot.toThrowErrorMatchingSnapshot
  29. });
  30. _expect.default.addSnapshotSerializer = _jestSnapshot.addSerializer;
  31. const jasmine = global.jasmine;
  32. jasmine.anything = _expect.default.anything;
  33. jasmine.any = _expect.default.any;
  34. jasmine.objectContaining = _expect.default.objectContaining;
  35. jasmine.arrayContaining = _expect.default.arrayContaining;
  36. jasmine.stringMatching = _expect.default.stringMatching;
  37. jasmine.addMatchers = jasmineMatchersObject => {
  38. const jestMatchersObject = Object.create(null);
  39. Object.keys(jasmineMatchersObject).forEach(name => {
  40. jestMatchersObject[name] = function (...args) {
  41. // use "expect.extend" if you need to use equality testers (via this.equal)
  42. const result = jasmineMatchersObject[name](null, null); // if there is no 'negativeCompare', both should be handled by `compare`
  43. const negativeCompare = result.negativeCompare || result.compare;
  44. return this.isNot
  45. ? negativeCompare.apply(
  46. null, // @ts-expect-error
  47. args
  48. )
  49. : result.compare.apply(
  50. null, // @ts-expect-error
  51. args
  52. );
  53. };
  54. });
  55. _expect.default.extend(jestMatchersObject);
  56. };
  57. };
  58. exports.default = _default;