使用jest替换mocha

This commit is contained in:
xief
2024-08-02 09:50:12 +08:00
parent 941e8a1d8e
commit b5d651d7ca
9 changed files with 2754 additions and 93 deletions

View File

@@ -1,7 +1,7 @@
import { assert } from "chai";
import { describe, it, expect } from '@jest/globals'
import { chromium } from "playwright";
describe('平台', async function(){
describe('平台', function(){
it('登陆', async function(){
@@ -29,13 +29,12 @@ describe('平台', async function(){
await page.click('button:has-text("登录")');
let path = await page.evaluateHandle(()=>window.location.pathname);
assert.notEqual('/user-login.html',await path.jsonValue());
expect(await path.jsonValue()).not.toEqual('/user-login.html')
// ---------------------
after(async () => {
await context.close();
await browser.close();
})
await context.close();
await browser.close();
})