You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A few files in the lib use this, however when I go to test the decorators I have made everything works fine when I made the first file, so I have a test file which tests one of the decorators. As I say this all works fine, everything is as expected, but then when I went to add another test file for a different decorator just the mere fact that I use the decorator in another file, it causes the first file with tests to blow up... so for example:
test1.ts
import {SomeDecorator} from "../some/relative/lib"; // this uses the above helper
class SomeModel
{
@SomeDecorator
public someProp;
}
// some tests that use that model, and all pass
test2.ts
import {SomeOtherDecorator} from "../some/relative/lib"; // this uses the above helper
class SomeModel
{
@SomeOtherDecorator
public someProp;
}
Just having that decorator in there causes the test1.ts file tests to stop passing, as it seems to remove all metadata, however if I were to comment out the SomeModel it works fine and all tests in the first file pass. I am not sure if webpack will be removing the import when there is nothing that uses it (using webpack 1.* atm).
So is this because every time it is included it deletes the existing metadata? I tried putting a console.log("Hello") in the helper file after the import just to see how many times its run, and it seems to get run once per file.
If it helps here is an example decorator which would be used, and is the one which is used in both files:
I have a helper class which basically wraps the dealing with metadata:
A few files in the lib use this, however when I go to test the decorators I have made everything works fine when I made the first file, so I have a test file which tests one of the decorators. As I say this all works fine, everything is as expected, but then when I went to add another test file for a different decorator just the mere fact that I use the decorator in another file, it causes the first file with tests to blow up... so for example:
test1.ts
test2.ts
Just having that decorator in there causes the
test1.ts
file tests to stop passing, as it seems to remove all metadata, however if I were to comment out theSomeModel
it works fine and all tests in the first file pass. I am not sure if webpack will be removing the import when there is nothing that uses it (using webpack 1.* atm).So is this because every time it is included it deletes the existing metadata? I tried putting a
console.log("Hello")
in the helper file after the import just to see how many times its run, and it seems to get run once per file.If it helps here is an example decorator which would be used, and is the one which is used in both files:
The text was updated successfully, but these errors were encountered: