Jasmine 如何在另一个js文件中执行一个js文件

Jasmine 如何在另一个js文件中执行一个js文件,jasmine,protractor,Jasmine,Protractor,假设有一个包含10个it块的.js文件,现在在第6个it块中,需要执行另一个js文件,比如B.js,我不确定这是什么意思,但是可以有几个描述块,其中包含it块 describe('Main file', () => { describe('Describe A', () => { it('some it block from A', async () => { // code here }); });

假设有一个包含10个it块的.js文件,现在在第6个it块中,需要执行另一个js文件,比如B.js,我不确定这是什么意思,但是可以有几个
描述
块,其中包含
it

describe('Main file', () => {
    describe('Describe A', () => {
        it('some it block from A', async () => {
            // code here
        });
    });

    describe('Describe B', () => {
        it('some it block from B', async () => {
            // code here
        });
    });
});  

谢谢你的回复。是的,这不是我所期望的。也许你会发现这个链接很有用。我花了2秒钟到谷歌谢谢你的回复。是的,这不是我所期望的。场景:A.js:description('Main file',()=>{it('some it block1',async()=>{//code here});it('some it block2',async()=>{//code here});it('some it block3',async()=>{});B.js:description('Main file',()=>{it('some it block1',async()=>{//code here});it('some it block2',async()=>{//code here});it('some it block3',async()=>{//In this it block I wan to execute A.js});我明白你想要实现什么,但很可能这是不可能的。但我甚至想不出这样做的可能用例。如果你能解释一下你为什么要这么做,我可以帮你找到一个解决办法。我同意谢尔盖的观点,基本上你不能把一个
it
块放在另一个
it
块中。或
块内的
描述
。也许可以向我们解释为什么要这样做,这样我们可以提供更好的帮助我有2个js文件[A.js和一些it块,B.js和一些it块作为单独的测试套件]。现在在A.js中,一个it块requires作为前置条件应该执行B.js中提到的所有流[所有it块]。相反,将所有it块从B.js粘贴到A.js it块,是否有办法处理它。这就是我目前的情况。希望你能理解。