Skip to content

Commit

Permalink
Tests TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Nov 26, 2023
1 parent 50977ef commit c6aff5d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/classes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3441,6 +3441,7 @@ describe('Classes', () => {

// NB: `super` var is no longer used in class constructors, so this test is extraneous.
// But leaving it here in case that changes.
// TODO: Add methods to subclasses. Or maybe this test doesn't make sense any more.
itSerializes('in explicit constructor', {
in() {
class SuperKlass1 {
Expand Down Expand Up @@ -4126,6 +4127,7 @@ describe('Classes', () => {
// NB: These tests relate to correct functioning of instrumentation
itSerializes('with const definition', {
// NB: Shadow `C` var inside class ctor so instrumentation has to create temp var to access `C`
// TODO: Change this test to use a method, not constructor.
in() {
class S {}
const C = class extends S {
Expand Down Expand Up @@ -4158,6 +4160,7 @@ describe('Classes', () => {
});

itSerializes('with let definition', {
// TODO: Change this test to use a method. Class alone does not require `super` var.
in() {
class S {}
let x = 123, // eslint-disable-line no-unused-vars, prefer-const
Expand All @@ -4178,6 +4181,7 @@ describe('Classes', () => {
});

itSerializes('with var definition', {
// TODO: Change this test to use a method. Class alone does not require `super` var.
in() {
class S {}
var x = 123, // eslint-disable-line no-unused-vars, no-var, vars-on-top
Expand All @@ -4198,6 +4202,7 @@ describe('Classes', () => {
});

itSerializes('with = assignment', {
// TODO: Change this test to use a method. Class alone does not require `super` var.
in() {
class S {}
let C;
Expand All @@ -4218,6 +4223,7 @@ describe('Classes', () => {
});

itSerializes('with &&= assignment', {
// TODO: Change this test to use a method. Class alone does not require `super` var.
in() {
class S {}
let C = true;
Expand All @@ -4238,6 +4244,7 @@ describe('Classes', () => {
});

itSerializes('with ||= assignment', {
// TODO: Change this test to use a method. Class alone does not require `super` var.
in() {
class S {}
let C = false;
Expand All @@ -4258,6 +4265,7 @@ describe('Classes', () => {
});

itSerializes('with ??= assignment', {
// TODO: Change this test to use a method. Class alone does not require `super` var.
in() {
class S {}
let C = null;
Expand All @@ -4278,6 +4286,7 @@ describe('Classes', () => {
});

itSerializes('with = assignment pattern', {
// TODO: Change this test to use a method. Class alone does not require `super` var.
in() {
class S {}
let {
Expand Down Expand Up @@ -4409,6 +4418,7 @@ describe('Classes', () => {
describe('transpiled super treats computed object property names correctly', () => {
// These tests are primarily to ensure the instrumentation works correctly,
// rather than the serialization.
// TODO: Change this test to use a method. Class alone does not require `super` var.
itSerializes('function call used as object prop key only called once', {
in() {
const fn = spy(() => 'Y');
Expand Down Expand Up @@ -4439,6 +4449,7 @@ describe('Classes', () => {
});

itSerializes('object used as object prop key has `.toString()` only called once', {
// TODO: Change this test to use a method. Class alone does not require `super` var.
in() {
const o = {};
o.toString = spy(() => 'Y');
Expand Down Expand Up @@ -4469,6 +4480,7 @@ describe('Classes', () => {
});

itSerializes('undefined used as object prop key', {
// TODO: Change this test to use a method. Class alone does not require `super` var.
in() {
class X {}
return {
Expand Down

0 comments on commit c6aff5d

Please sign in to comment.