After API review we decided to revert it:
* VSCode extension and UI mode users already get the (runtime) error if
the tag is not prefixed
* The typescript error message is not very nice
* The type change would break those clients that generate tests with
tags passed as string
This reverts commit 90e7b9ebac.
			
			
This commit is contained in:
		
							parent
							
								
									9f466a1ead
								
							
						
					
					
						commit
						565aed6c39
					
				| 
						 | 
				
			
			@ -1825,10 +1825,8 @@ type TestDetailsAnnotation = {
 | 
			
		|||
  description?: string;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
type TestDetailsTag = `@${string}`;
 | 
			
		||||
 | 
			
		||||
export type TestDetails = {
 | 
			
		||||
  tag?: TestDetailsTag | TestDetailsTag[];
 | 
			
		||||
  tag?: string | string[];
 | 
			
		||||
  annotation?: TestDetailsAnnotation | TestDetailsAnnotation[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -147,18 +147,6 @@ test('should enforce @ symbol', async ({ runInlineTest }) => {
 | 
			
		|||
  expect(result.output).toContain(`Error: Tag must start with "@" symbol, got "foo" instead.`);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('types should enforce @ symbol', async ({ runTSC }) => {
 | 
			
		||||
  const result = await runTSC({
 | 
			
		||||
    'stdio.spec.ts': `
 | 
			
		||||
      import { test, expect } from '@playwright/test';
 | 
			
		||||
      test('test1', { tag: 'foo' }, () => {
 | 
			
		||||
      });
 | 
			
		||||
    `
 | 
			
		||||
  });
 | 
			
		||||
  expect(result.exitCode).toBe(2);
 | 
			
		||||
  expect(result.output).toContain('error TS2322: Type \'"foo"\' is not assignable to type \'`@${string}` | `@${string}`[] | undefined');
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('should be included in testInfo', async ({ runInlineTest }, testInfo) => {
 | 
			
		||||
  const result = await runInlineTest({
 | 
			
		||||
    'a.test.ts': `
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,10 +70,8 @@ type TestDetailsAnnotation = {
 | 
			
		|||
  description?: string;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
type TestDetailsTag = `@${string}`;
 | 
			
		||||
 | 
			
		||||
export type TestDetails = {
 | 
			
		||||
  tag?: TestDetailsTag | TestDetailsTag[];
 | 
			
		||||
  tag?: string | string[];
 | 
			
		||||
  annotation?: TestDetailsAnnotation | TestDetailsAnnotation[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue