def METHOD_NAME():
    # Define components which shouldn't have depth
    exceptions = ("PanoramaComponent",)
    # Create experiment
    exp = experiment.Experiment()
    rt = experiment.routines.Routine(exp=exp, name="testRoutine")
    exp.addRoutine("testRoutine", rt)
    exp.flow.addRoutine(rt, 0)
    # Add one of each component to the routine
    for compName, compClass in experiment.getAllComponents().items():
        # Settings components don't count so don't include one at all
        if compName in ("SettingsComponent",):
            continue
        comp = compClass(exp=exp, parentName="testRoutine", name=f"test{compClass.__name__}")
        rt.addComponent(comp)
    # For each component...
    for comp in rt:
        compName = type(comp).__name__
        # This won't be relevant for non-visual stimuli
        if compName in exceptions or not isinstance(comp, experiment.components.BaseVisualComponent):
            continue
        for target in ("PsychoPy", "PsychoJS"):
            # Skip if target isn't applicable
            if target not in comp.targets:
                continue
            # Crate buffer to get component code
            buff = IndentingBuffer(target=target)
            # Write init code
            if target == "PsychoJS":
                comp.writeInitCodeJS(buff)
                sought = "depth:"
            else:
                comp.writeInitCode(buff)
                sought = "depth="
            script = buff.getvalue()
            # Unless excepted, check that depth is in the output
            assert sought in script.replace(" ", ""), (
                f"Could not find any reference to depth in {target} init code for {compName}:\n"
                f"{script}\n"
                f"Any component drawn to the screen should be given a `depth` on init. If this component is a special "
                f"case, you can mark it as exempt by adding it to the `exceptions` variable in this test.\n"
            )