Skip to content

Commit

Permalink
Clean up old tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Nov 16, 2023
1 parent ce7fc4a commit ac06c35
Showing 1 changed file with 2 additions and 62 deletions.
64 changes: 2 additions & 62 deletions packages/react-transform/test/node/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function runGeneratedTestCases(config: TestCaseConfig) {
});
}

describe.only("object method components", () => {
describe("object method components", () => {
runTestCases(config, objMethodComp(codeConfig));
});

Expand Down Expand Up @@ -170,7 +170,7 @@ function runGeneratedTestCases(config: TestCaseConfig) {
});
}

describe.only("React Signals Babel Transform", () => {
describe("React Signals Babel Transform", () => {
describe("auto mode transforms", () => {
runGeneratedTestCases({
useValidAutoMode: true,
Expand Down Expand Up @@ -418,46 +418,6 @@ describe("React Signals Babel Transform", () => {

runTest(inputCode, expectedOutput, { mode: "manual" });
});

it("transforms object properties assigned to functions with leading opt-in JSDoc comments", () => {
const inputCode = `
var obj = {};
/** @trackSignals */
obj.a = () => {};
/** @trackSignals */
obj.b = function () {};
/** @trackSignals */
obj["c"] = function () {};
`;

const expectedOutput = `
import { useSignals as _useSignals } from "@preact/signals-react/runtime";
var obj = {};
/** @trackSignals */
obj.a = () => {
var _effect = _useSignals();
try {} finally {
_effect.f();
}
};
/** @trackSignals */
obj.b = function () {
var _effect2 = _useSignals();
try {} finally {
_effect2.f();
}
};
/** @trackSignals */
obj["c"] = function () {
var _effect3 = _useSignals();
try {} finally {
_effect3.f();
}
};
`;

runTest(inputCode, expectedOutput, { mode: "manual" });
});
});

describe("auto mode opt-out transformations", () => {
Expand Down Expand Up @@ -499,26 +459,6 @@ describe("React Signals Babel Transform", () => {

runTest(inputCode, expectedOutput, { mode: "auto" });
});

it("skips transforming object properties assigned to functions with leading opt-out JSDoc comments", () => {
const inputCode = `
var obj = {};
/** @noTrackSignals */
obj.a = () => <div />;
/** @noTrackSignals */
obj.b = function () {
return <div />;
};
/** @noTrackSignals */
obj["c"] = function () {
return <div />;
};
`;

const expectedOutput = inputCode;

runTest(inputCode, expectedOutput, { mode: "auto" });
});
});

describe("auto mode no transformations", () => {
Expand Down

0 comments on commit ac06c35

Please sign in to comment.