Jest找不到文件加载器模块

时间:2018-06-02 07:00:13

标签: javascript webpack jest webpack-file-loader

我的一个文件是创建一个新的Worker,它使用文件加载器模块来实现。

这是我的代码:

from airbnb.HomePageObject import HomePage
from airbnb.BaseTest import TestBase

class Test(TestBase):

    def __init__(self,testName,browser):
        super(Test,self).__init__(testName,browser)

    def testName(self):
        try:
            self.driver.get(self.url)

            h_page = HomePage()

            f_page = h_page.seachPlace("Sicily,Italy")

            f_page.selectExperience()

        finally:
            self.driver.quit()

问题是当运行jest时,我收到错误import unittest from airbnb.TestCase1 import Test from airbnb.TestCase2 import Test loader = unittest.TestLoader() test_names = loader.getTestCaseNames(Test) suite = unittest.TestSuite() for test in test_names: suite.addTest(Test(test,"chrome")) runner = unittest.TextTestRunner() result = runner.run(suite)

我该如何解决这个问题?

0 个答案:

没有答案