【发布时间】:2018-10-03 09:30:21
【问题描述】:
对于我的项目,我需要导入在 .ts 文件中声明的变量以在 .js 文件中使用。我无法将 js 文件更改为 ts 文件,因为其中写入的其他函数会受到影响。
我尝试了很多:
import AvailableBalances = require('./app.Processing');
import { AvailableBalances } from './app.Processing';
但没有任何帮助。下面是我在 .ts 文件中的代码。 'Comment' 是变量例如,我需要在 .js 文件中导入和使用。
describe('Login', function () {
it('Should able to login into the Webpage', function () {
browser.driver.manage().window().maximize();
browser.get('https://inside.pilot.theprincipal.net/rnqLiabilityManagement/');
var Comment = 'Login Successful';
【问题讨论】:
-
@swit 我查看了链接但是,我的 .ts 文件是一个测试用例文件,它以“描述”和“它”格式编写。在此之下,我声明了一个需要在我的配置文件 (.js) 中使用的变量。我没有在 .ts 文件中使用类
标签: javascript node.js typescript protractor