mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Refactor process.js & process.test.js to TypeScript (#58464)
This commit is contained in:
parent
c76183a961
commit
8e4fa4046b
@ -11,21 +11,19 @@
|
|||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import traceGenerator from '../demo/trace-generators';
|
import traceGenerator from '../demo/trace-generators';
|
||||||
|
import { TraceProcess } from '../types/trace';
|
||||||
|
|
||||||
import * as processSelectors from './process';
|
import * as processSelectors from './process';
|
||||||
|
|
||||||
const generatedTrace = traceGenerator.trace({ numberOfSpans: 45 });
|
const generatedTrace = traceGenerator.trace({ numberOfSpans: 45 });
|
||||||
|
|
||||||
it('getProcessServiceName() should return the serviceName of the process', () => {
|
it('getProcessServiceName() should return the serviceName of the process', () => {
|
||||||
const proc = generatedTrace.processes[Object.keys(generatedTrace.processes)[0]];
|
const proc: TraceProcess = generatedTrace.processes[Object.keys(generatedTrace.processes)[0]];
|
||||||
|
|
||||||
expect(processSelectors.getProcessServiceName(proc)).toBe(proc.serviceName);
|
expect(processSelectors.getProcessServiceName(proc)).toBe(proc.serviceName);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getProcessTags() should return the tags on the process', () => {
|
it('getProcessTags() should return the tags on the process', () => {
|
||||||
const proc = generatedTrace.processes[Object.keys(generatedTrace.processes)[0]];
|
const proc: TraceProcess = generatedTrace.processes[Object.keys(generatedTrace.processes)[0]];
|
||||||
|
|
||||||
expect(processSelectors.getProcessTags(proc)).toBe(proc.tags);
|
expect(processSelectors.getProcessTags(proc)).toBe(proc.tags);
|
||||||
});
|
});
|
@ -12,5 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
export const getProcessServiceName = (proc) => proc.serviceName;
|
import { TraceProcess } from '../types/trace';
|
||||||
export const getProcessTags = (proc) => proc.tags;
|
|
||||||
|
export const getProcessServiceName = (proc: TraceProcess) => proc.serviceName;
|
||||||
|
export const getProcessTags = (proc: TraceProcess) => proc.tags;
|
Loading…
Reference in New Issue
Block a user