@angular/core
Version:
Angular - the core framework
38 lines • 3.67 kB
JavaScript
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/core/schematics/migrations/static-queries/strategies/test_strategy/test_strategy", ["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryTestStrategy = void 0;
/**
* Query timing strategy that is used for queries used within test files. The query
* timing is not analyzed for test files as the template strategy cannot work within
* spec files (due to missing component modules) and the usage strategy is not capable
* of detecting the timing of queries based on how they are used in tests.
*/
class QueryTestStrategy {
setup() { }
/**
* Detects the timing for a given query. For queries within tests, we always
* add a TODO and print a message saying that the timing can't be detected for tests.
*/
detectTiming(query) {
return { timing: null, message: 'Timing within tests cannot be detected.' };
}
}
exports.QueryTestStrategy = QueryTestStrategy;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdF9zdHJhdGVneS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc2NoZW1hdGljcy9taWdyYXRpb25zL3N0YXRpYy1xdWVyaWVzL3N0cmF0ZWdpZXMvdGVzdF9zdHJhdGVneS90ZXN0X3N0cmF0ZWd5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7OztJQUtIOzs7OztPQUtHO0lBQ0gsTUFBYSxpQkFBaUI7UUFDNUIsS0FBSyxLQUFJLENBQUM7UUFFVjs7O1dBR0c7UUFDSCxZQUFZLENBQUMsS0FBd0I7WUFDbkMsT0FBTyxFQUFDLE1BQU0sR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