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.

getSnapshotStatus.js 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function _chalk() {
  7. const data = _interopRequireDefault(require('chalk'));
  8. _chalk = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _jestUtil() {
  14. const data = require('jest-util');
  15. _jestUtil = function () {
  16. return data;
  17. };
  18. return data;
  19. }
  20. function _interopRequireDefault(obj) {
  21. return obj && obj.__esModule ? obj : {default: obj};
  22. }
  23. /**
  24. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  25. *
  26. * This source code is licensed under the MIT license found in the
  27. * LICENSE file in the root directory of this source tree.
  28. */
  29. const ARROW = ' \u203A ';
  30. const DOT = ' \u2022 ';
  31. const FAIL_COLOR = _chalk().default.bold.red;
  32. const SNAPSHOT_ADDED = _chalk().default.bold.green;
  33. const SNAPSHOT_UPDATED = _chalk().default.bold.green;
  34. const SNAPSHOT_OUTDATED = _chalk().default.bold.yellow;
  35. var _default = (snapshot, afterUpdate) => {
  36. const statuses = [];
  37. if (snapshot.added) {
  38. statuses.push(
  39. SNAPSHOT_ADDED(
  40. ARROW +
  41. (0, _jestUtil().pluralize)('snapshot', snapshot.added) +
  42. ' written.'
  43. )
  44. );
  45. }
  46. if (snapshot.updated) {
  47. statuses.push(
  48. SNAPSHOT_UPDATED(
  49. ARROW +
  50. (0, _jestUtil().pluralize)('snapshot', snapshot.updated) +
  51. ' updated.'
  52. )
  53. );
  54. }
  55. if (snapshot.unmatched) {
  56. statuses.push(
  57. FAIL_COLOR(
  58. ARROW +
  59. (0, _jestUtil().pluralize)('snapshot', snapshot.unmatched) +
  60. ' failed.'
  61. )
  62. );
  63. }
  64. if (snapshot.unchecked) {
  65. if (afterUpdate) {
  66. statuses.push(
  67. SNAPSHOT_UPDATED(
  68. ARROW +
  69. (0, _jestUtil().pluralize)('snapshot', snapshot.unchecked) +
  70. ' removed.'
  71. )
  72. );
  73. } else {
  74. statuses.push(
  75. SNAPSHOT_OUTDATED(
  76. ARROW +
  77. (0, _jestUtil().pluralize)('snapshot', snapshot.unchecked) +
  78. ' obsolete'
  79. ) + '.'
  80. );
  81. }
  82. snapshot.uncheckedKeys.forEach(key => {
  83. statuses.push(` ${DOT}${key}`);
  84. });
  85. }
  86. if (snapshot.fileDeleted) {
  87. statuses.push(SNAPSHOT_UPDATED(ARROW + 'snapshot file removed.'));
  88. }
  89. return statuses;
  90. };
  91. exports.default = _default;