test262 icon indicating copy to clipboard operation
test262 copied to clipboard

add a test for decorator context names

Open mansona opened this issue 1 year ago • 8 comments

This was taken from the babel test suite https://github.com/babel/babel/blob/87ec4fc3d2cf44c30ef007f7da47d7177e07ffec/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors/context-name/input.js#L1

mansona avatar Mar 22 '24 18:03 mansona

Thanks for the review @ptomato 🎉

I've updated the message and removed my TODO item for removing the seemingly valid syntax 👍 is there something that I need to do to the frontmatter to mark it that it's currently expected to fail?

I don't really have a good sense of whether we already have coverage for this stuff

So I have 2 thoughts on this. If adding this test has identified a legitimate error that should have passed then this is clearly adding coverage for something that wasn't already covered 😂 But looking at the files that are already in the suite for decorators it seems that there are only syntax tests that have the comment This file was procedurally generated from the following sources so I'm assuming there are no hand-crafted tests that have any assertions, or at least that's how it seems from my investigations.

But anyway, I'm adding these tests with the help of @pzuraq so I'm sure she'll be the best person to comment on this 😂

mansona avatar Mar 23 '24 10:03 mansona

Decorators coverage right now is something like 0.1%, so thank you very much!

If you plan to submit more tests, it would be incredibly useful if you could write a "testing plan" (like https://github.com/tc39/test262/issues/3725) so that it's easier to tell what's covered and what's not.

nicolo-ribaudo avatar Mar 23 '24 11:03 nicolo-ribaudo

Please add a copyright header as well

Ms2ger avatar Mar 25 '24 11:03 Ms2ger

is there something that I need to do to the frontmatter to mark it that it's currently expected to fail?

@mansona There are no expected-to-fail tests, so nothing to do on your end. (The way it works is, a hypothetical JS implementation that correctly implements the spec plus all stage-3 proposals must pass all test262 tests. Implementations maintain their own expected-to-fail lists separately.)

ptomato avatar Mar 25 '24 16:03 ptomato

Please add a copyright header as well

So I was wondering about that one 🤔 As I said in the description I copied the test from the babel test suite, so should I set the copyright header to the original author? Is there any guidance on that?

mansona avatar Mar 30 '24 16:03 mansona

As I said in the description I copied the test from the babel test suite, so should I set the copyright header to the original author? Is there any guidance on that?

Copyrights are annoying to deal with, sorry. Ideally the Babel test file would have its own copyright header, but it doesn't. You'd have to ask the Babel project if the copyright line in babel/LICENSE ("Copyright (c) 2014-present Sebastian McKenzie and other contributors") applies to everything in the babel repo. If not, then you'd have to talk to the authors of that file figure out who owns the copyright.

(Public service announcement: Open source projects, please require license and copyright headers in every file in the repo! There are tools such as REUSE that you can drop into your CI and make this easy, or you can roll your own like test262 does :smile:)

ptomato avatar Apr 01 '24 19:04 ptomato

Hey, could you use "The Babel Team"? Unfortunately different packages in our repo have different author/copyright owner, so the best thing to do is to look for the author field in the relevant package.json (https://github.com/babel/babel/blob/dd699a8509f02efd7e5a45d49cf24b757a59e4a2/packages/babel-plugin-proposal-decorators/package.json#L4C14-L4C30)

nicolo-ribaudo avatar Apr 01 '24 19:04 nicolo-ribaudo

@nicolo-ribaudo I've made a test plan in this issue: https://github.com/tc39/test262/issues/4042

pzuraq avatar Apr 03 '24 17:04 pzuraq